Core Java (GATE - CS)
Casual Mode - Take your time!
1 / 15
Correct
0
Incorrect
0
Score
0%
Multiple Choice
What changes will make the above code compile?
class X { X () { } private void one () { }
}
public class Y extends X { Y () { } private void two () { one();
}
public static void main (String [] args) { new Y().two ();
}
}
- Removing the private modifier from the two () method
- Adding the public modifier to the declaration of class X
- Changing the private modifier on the declaration of the one() method to protect
- Removing the Y () constructor
- None of these