Hello,
I'm planning to take
SCJP 1.6 in Dec, 2010 and reading Kathy Sierra and Bert Bates' SCJP study guide. Just completed chapter 1 and took SELF
TEST.
Last question reads:
9. Given:
4. public class Frodo extends Hobbit {
5. public static void main(
String[] args) {
6. Short myGold = 7;
7. System.out.println(countGold(myGold, 6));
8. }
9. }
10. class Hobbit {
11. int countGold(int x, int y) { return x + y; }
12. }
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
I selected C because 'Short' is not in list of keywords for java1.6. It was supposed to be 'short' (all-lowercase). The answer was given as D.
Is there something I got confused/did not understand about keywords or variable types ?
Thankyou.