Question 34 :

Which of the following statements about the following code fragment are true? 
Picture
Select 2 choices.

a.) The code compiles successfully and displays "Test".
b.) Changing the code at line 13 to "public void print(int x)" will allow the code to compile correctly.
c.) The code fails to compile. The compiler complains about duplicate methods.
d.) Changing the return type on line 13 from 'void' to 'int' will allow the code to compile correctly.


Question 35

What will be the result of running the following code? 
Picture
a.) The output: Value is - Hello
b.) The output: Value is - Hello world
c.) A compiler error
d.) No output
e.) An exception


Question 36:

Given the code below, which access modifiers (public, protected, or private) can legally be placed before the myMethod() method on line 3, if no other changes are made to the code? If line 3 is left as it is, which keywords can legally be placed before the myMethod method on line 8?
Picture
Choose one answer.

a. private or nothing (default) on line 3. Nothing (default) or protected or public on line 8. 
b. public or protected on line 3. private or nothing (default) on line 8. 
c. Nothing (default) or protected or public on line 3. private or nothing (default) on line 8. 
d. public on line 3 and private on line8.
<<<Previous Page         Next Page >>>


ALL about SCJP = SCJP 1.6, mock, certification, scjp 1.5 , scjp questions, scjp books, scjp hand written notes, scjp dumps, scjp trainings, scjp video tutorials, scjp simulators etc.