JAVA DUMPS 8(SCJP)

QUESTION NO: 39

Which two are valid declarations within an interface definition? (Choose two)

A. void methoda();

B. public double methoda();

C. public final double methoda();

D. static void methoda(double d1);

E. protected void methoda(double d1);

Answer: A, B


 

QUESTION NO: 40

Which two allow the class Thing to be instantiated using new Thing()? (Choose two)

A. public class Thing {

}

B. public class Thing {

public Thing() {}

}

C. public class Thing {

public Thing(void) {}

}

D. public class Thing {

public Thing(String s) {}

}

E. public class Thing {

public void Thing() {}

public Thing(String s) {}

}

Answer: A, B


 

QUESTION NO: 41

Given:

11. Float f = new Float("12");

12. switch (f) {

13. case 12: System.out.printIn("Twelve");

14. case 0: System.out.printIn("Zero");

15. default: System.out.printIn("Default");

16. }

What is the result?

A. Zero

B. Twelve

C. Default

D. Twelve

Zero

Default

E. Compilation fails.

Answer: E


 

QUESTION NO: 42

Given:

1. public class X {

2. public static void main(String [] args) {

3. try {

4. badMethod();

5. System.out.print("A");

6. }

7. catch (Exception ex) {

8. System.out.print("B");

9. }

10. finally {

11. System.out.print("C");

12. }

13. System.out.print("D");

14. }

15. public static void badMethod() {

16. throw new RuntimeException();

17. }

18. }

What is the result?

A. AB

B. BC

C. ABC

D. BCD

E. Compilation fails.

Answer: D


 

QUESTION NO: 43

Given:

1. class TestA {

2. TestB b;

3. TestA() {

4. b = new TestB(this);

5. }

6. }

7. class TestB {

8. TestA a;

9. TestB(TestA a) {

10. this.a = a;

11. }

12. }

13. class TestAll {

14. public static void main (String args[]) {

15. new TestAll().makeThings();

16. // ...code continues on

17. }

18. void makeThings() {

19. TestA test = new TestA();

20. }

21. }

Which two statements are true after line 15, before main completes? (Choose two)

A. Line 15 causes a stack overflow.

B. An exception is thrown at runtime.

C. The object referenced by a is eligible for garbage collection.

D. The object referenced by b is eligible for garbage collection.

E. The object referenced by a is not eligible for garbage collection.

F. The object referenced by b is not eligible for garbage collection.

Answer: C, F

1 comments:

Anonymous said...

Candidates who find exam really challenging and not confidant about their success, dumps are good substitute for them as they ensure your success as most of the questions are from them. If anybody interested in SCJP6 dumps..mail me at mp7504@gmail.com.

Post a Comment