This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
first you are missing a semi colon. try to find it. second if you put this semicolon back the output is not easy the output is : Cannot find symbol symbol : method printDifficulty() location: class SCJPExam myExam.printDifficulty();
with inheritance the output is easy. the method in protected so it can be inherited. what about the member variable ? does the subclass has 2 variables with the same name and 2 different values ??? or is it just that the method access the member in its class first ??