+ 1
Whats wrong with my this code.
Inheritence https://code.sololearn.com/cQvYe6Kxv9Qy/?ref=app
3 Respuestas
+ 1
All classes have constructors by default: if you do not create a class constructor yourself, Java creates one for you. However, then you are not able to set initial values for object attributes.
+ 1
Add a default constructor in cuboid..
Or manually call parent constructor of box with required parameters.. Because parent class contructer is automatically called when child class object is created so there is mitch matching arguments...
+ 1
class box extends cuboid{
box(){
super(1,1,1);
// dim1=dim2=dim3=1;
}