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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started