You are given the class file for a class called Secret. However, you do not have the source code or any
information about the internals of the Secret class. You do know that the class has a protected int
variable called i. What does the following application print out?
1. class Mine extends Secret {
2. public static void main(
String[] args) {
3. Mine m1 = new Mine(); m1.i = 5;
4. Mine m2 = new Mine(); m1.i = 5;
5. if (m1.equals(m2))
6. System.out.println("YES");
7. else
8. System.out.println("NO");
9. }
10. }
IT IS IMPOSSIBLE TO KNOW .
The result of the call to equals() on line 5 depends on how the method was written in the Secret
superclass.
-------
This is a question from RHE. I have not understand the answer.
Can anybody explain me the concept behind it.
Thanks
Padmini