这是代码,
class Car
{
public static String owner;
public static String car;
public static Integer plate_num;
public static String car_color;
Car(String owner, String car_name, Integer num, String color)
{
owner = owner;
car = car_name;
plate_num = num;
car_color = color;
}
Void display ()
{
System.out.println("The owner of the car is "+ owner + "and Car model is " + car);
System.out.println("The car number is "+ plate_num + "and Car color is " + car_color);
} // ---> here …Run Code Online (Sandbox Code Playgroud) class A
{
int i,j;
A (int x, int y)
{
i = x;
j = y;
}
void show()
{
System.out.println("the value of i and j are " + i + " " + j);
}
}
class B extends A // here is the error
{
int k;
B (int z, int a, int b )
{
k = z;
i = a;
j = b;
}
void display()
{
System.out.println("the value of k is " +k);
} …Run Code Online (Sandbox Code Playgroud) java ×2