Home > Back-end >  Program is wrong, please correct them.
Program is wrong, please correct them.

Time:10-22

Class A {int x;

A (int x) {this. X=x}}

Class B extends A {int y; }

Public class test {

Public static void main (String [] args)

B=new b1 (B) :

}

CodePudding user response:

Is a constructor or method, if it is the constructor must be the same and the method name and the name of the class, if it is a method that should be void

CodePudding user response:

Class A {
{A (int A)

}
}

Class B extends A {

{
B (int a)Super (a);
}

}
  • Related