Greetings,
I've just started studying from
"OCA/OCP Java SE 7 Programmer I & II Study Guide (Exams 1Z0-803 & 1Z0-804)", by Kathy Sierra and Bert Bates. The book looks fantastic and is very thorough. However, I am really stuck on one simple question. I'm hoping someone here can help so that I can let it go.
Question number 9 on the Chapter 1 Self
Test:
9. Given
What is the result?
A. 13
B. Compilation fails due to multiple errors
C. Compilation fails due to an error on line 6
D. Compilation fails due to an error on line 7
E. Compilation fails due to an error on line 11
The answer I chose is B.
The correct answer stated is D due the countGold() method being invoked from static context. I get that. But why not the curly brace too?
Thanks!
Doug