I am a novice to Java and just learning OOP concepts. Please review my code. I am getting the following error.- Implicit Super Constructor is undefined.
You are receiving this error because BoxSuper does not have a no-arg constructor. During your constructor call in BoxSub, if you do not define the super constructor call Java tries to automatically call the no-arg super() constructor.
Either define a super constructor call in BoxSuper like so:
class BoxSub extends BoxSuper
{
int weight;
BoxSub(int a,int b,int c,int d)
{
super(a, b, c);
weight=d;
}
}
or define a no-arg constructor in BoxSuper:
class BoxSuper
{
int height;
int length;
int width;
BoxSuper(){}
...