+ 1
Write a program
To show that the declaration of a class " rectangle" which derives from the class "Square" which in turns derive from the class " shape"
3 Respostas
+ 4
class Shape {};
class Square: Shape {};
class Rectangle: Square {};
int main() {
return 0;
}
+ 3
Because the syntax of defining a class requires them. Within them, you would declare whatever properties and methods you would like the classes to contain.
0
I understand your concept but can you explain why are you using curly braces.