Question: public class YClass{ private int a; private int b; public void one() {...} public void two(int x, int y) {...} public YClass() {...} } public
public class YClass{
private int a;
private int b;
public void one()
{...}
public void two(int x, int y)
{...}
public YClass()
{...}
}
public class Xclass extent Yclass
{
private int z;
public void one()
{...}
public XClass()
{....}
A.write the definition of the default constructor of Ylass so that the instance variable of YClass are initialized to 0.
B.write the definition of the default constructor of Xclass so that the instance variable of XClass are initialized to 0.
C.Write the definition of the method two of YClass so that the instance variable a is initialized to the value of the first parameter of two, and the instance variable b is initialized to the value of the second parameter of two.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
