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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!