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 ;
public void setXint
;
other methods not shown
public class EnhancedData extends Data
private int ;
public void setYint
;
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. ;
II item. setY;
III. item. setx;
A I only
B II only
C I and II only
D II and III only
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
