This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
This Round Up game is fantastic! I truly love playing it. However I came across two questions that contradict each other??? Did I misinterpret the question/answer or are one of these answers incorrect? Question: Can a public method be overridden by a protected method? Answer: No, Overridding a method can NOT be more restrictive than the original method. Question: Can a method with no access modifier be overridden by a method marked protected? Answer: Yes, Overridden methods are allowed to have LESS restriction and since protected is less restricted than the default(package) that is allowed. Thank you,
"protected" is more restrictive than "public." "protected" is less restrictive than the default. Therefore, protected can override the default (opening up access) but it can't override public (closing off access.) OK? [ September 04, 2003: Message edited by: Ernest Friedman-Hill ]