Question: In java public class X { public void one ( ) { System,out.print ( Xone ) ; } public void two ( )
In java
public class X
public void one
System,out.printXone;
public void two
System.out.printXtwo;
public class Y extends X
public void one
System.out.printYone;
public void two
System.out.printYtwo;
public void testIt
one;
super.one;
two;
super.two;
Consider following code in the main method of another class. What is the output of line
Ymathrm code new Y;
code.one; line
code.testIt; line
YoneYtwoXoneXtwo
XoneXtwoYoneYtwo
YoneXoneYtwoXtwo
XoneYoneXtwoYtwo
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
