Question: public class BClass { private int x; public void set(int a) { x=a; } public void print() { Systme.out.print(x); } } public class DClass extents
public class BClass
{
private int x;
public void set(int a)
{
x=a;
}
public void print()
{
Systme.out.print(x);
}
}
public class DClass extents BClass
{
private int y;
public void set(int a,int b)
{
//postcondition; x=a; y=b;
}
public void print()
{...}
}
1.write the definition of the print method of DClass that overrides it.
2.Write the definition of the method set of the class DClass.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
