Question: what is the output? A obj=new A(); obj.x=15 Foo(obj); System.out.println(obj.z); System.out.println(obj.y); B obj2 = new B(7); Foo(obj2); obj2.w=obj.x+obj2.y: System.out.println(obj2.w); } public static void Foo(A 0){

what is the output? what is the output? A obj=new A(); obj.x=15 Foo(obj); System.out.println(obj.z); System.out.println(obj.y); B

A obj=new A(); obj.x=15 Foo(obj); System.out.println(obj.z); System.out.println(obj.y); B obj2 = new B(7); Foo(obj2); obj2.w=obj.x+obj2.y: System.out.println(obj2.w); } public static void Foo(A 0){ O.Z=--O.X+o.y- ) //--- public class A int x,y,z int k=80; public Act System.out.println(k): this.k=40; this.y=6; } //--- public class B extends Al int w; int k=150; public Al int b) super.k=b; System.out.println(this.k); )

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!