Question: public class Main { public static void main ( String args [ ] ) { A ref = new B ( ) ;ref.data = 3

public class Main {public static void main (String args[]){A ref = new B();ref.data =3;int data =4;ref. show (7);}class A {public int data;public void show(){System. out println(data);}class B extends A {public void show(int data){System. out printin(data);

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 Programming Questions!