Hi there,
I am currently studying Overriding methods using the "Oracle Certified Professional
Java SE7 Programmer Exams 1z0-804 and 1z0-805" and I am a bit confused.
I am studying the examples given on pages 70 - 73 of the book and I was wondering if ye guys can help me to understand the information.
The original method is:
The first piece of code:
Which outputs:
p1 equals p2 is false
p1 equals p3 is true
Then the main method is changed to:
Which outputs:
p1 equals p2 is false
p1 equals p3 is false
Could somebody explain to me what is going on? I don't want to be spoonfed, I just cannot wrap my head around this bit.
Why is the method not overridden?
Also why doesn't the second version of main not output the expected output(false, true)?