Question: a java program What is wrong with the following program? Compile it to check your answer. Modify the program so that it works. This program
a java program
What is wrong with the following program? Compile it to check your answer. Modify the program so that it works. This program is in the examples folder. class Ale
{ protected int x = 1;
public Ale(int xx)
{ x = xx; }
}
//================================================
class Bud extends Ale
{ private int y = 2; public void display()
{ System.out.println("x = " + x + " y = " + y); }
}
//================================================
class C10e4 {
public static void main(String[] args) { Bud b = new Bud();
b.display(); }
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
