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

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!