This isn't a real
test question, but it could easily be.
Assuming the following method is inside a class, and everything compiles nicely, what will happen when line #12 is executed?
(A) A java.lang.NullPointerException will definitely be thrown
(B) A java.lang.NullPointerException will definitely not be thrown
(C) Impossible to determine from the given code.
[code]
10. public void foo() {
11. MyTest test = null;
12. test.someMethod();
13. }
[code]
The answer is (C) because the method could be static. Wonder how many people would be caught by this.