Question: Consider the following class definitions. public class Data { private int x ; public void setX ( int n ) { x = n ;

Consider the following class definitions.
public class Data
{
private int x;
public void setX(int n)
{
x=n;
}
//... other methods not shown
}
public class EnhancedData extends Data
private int y;
public void setY(int n)
{
y=n;
}
//... other methods not shown
}
Assume that the following declaration appears in a client program.
EnhancedData item = new EnhancedData();
Which of the following statements would be valid?
I. item. y=16;
II. item. setY(16);
III. item. setx(25);
(A) I only
(B) II only
(C) I and II only
(D) II and III only
 Consider the following class definitions. public class Data { private int

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!