JAVA DUMPS 12(SCJP)

QUESTION NO: 60

Given:

1. public class Foo {

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

3. System.out.printIn( "Hello" + args[0] );

4. }

5. }

What is the result if this code is executed with the command line?

java Foo world

A. Hello

B. Hello Foo

C. Hello world

D. Compilation fails.

E. The code does not run.

Answer: E


 

QUESTION NO: 61

Given:

11. public void foo( boolean a, boolean b ){

12. if( a ) {

13. System.out.println( "A" );

14. } else if ( a && b ) {

15. System.out.println( "A&&B" );

16. } else {

17. if ( !b ) {

18. System.out.println( "notB" );

19. } else {

20. System.out.println( "ELSE" );

21. }

22. }

23. }

What is correct?

A. If a is true and b is true then the output is "A&&B".

B. If a is true and b is false then the output is "notB".

C. If a is false and b is true then the output is "ELSE".

D. If a is false and b is false then the output is "ELSE".

Answer: C

QUESTION NO: 62

Which two cause a compiler error? (Choose two)

A. int[] scores = {3, 5, 7};

B. int [][] scores = {2,7,6}, {9,3,45};

C. String cats[] = {"Fluffy", "Spot", "Zeus"};

D. boolean results[] = new boolean [3] {true, false, true};

E. Integer results[] = {new Integer(3), new Integer(5), new

Integer(8)};

F. String[] dogs = new String[]{new String("Fido"),new

String("Spike"), new String("Aiko")};

Answer: B, D


 

QUESTION NO: 63

Given:

11. int i = 0, j = 5;12. tp; for (;;) {

12. i++;

13. for(;;) {

14. if (i> --j) {

15. break tp;

16. break tp;

17. }

18. }

19. System.out.printIn("i=" +i ",j ="+j);

What is the result?

A. i = 1, j = 0

B. i = 1, j = 4

C. i = 3, j = 4

D. i = 3, j = 0

E. Compilation fails.

Answer: E


 

QUESTION NO: 64

Given:

1. public abstract class Test {

2. public abstract void methodA();

3.

4. public abstract void methodB()

5. {

6. System.out.println("Hello");

7. }

8. }

Which two changes, independently applied, allow this code to compile? (Choose two)

A. Add a method body to methodA.

B. Replace lines 5 – 7 with a semicolon (";").

C. Remove the abstract qualifier from the declaration of Test.

D. Remove the abstract qualifier from the declaration of methodA.

E. Remove the abstract qualifier from the declaration of methodB.

Answer: B, E


 

QUESTION NO: 65

Given:

1. public class Test {

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

3. int i =1, j = 0;

4. switch(i) {

5. case 2: j +=6;

6. case 4: j +=1;

7. default: j +=2;

8. case 0: j +=4;

9. }

10. System.out.printIn("j =" +j);

11. }

12. }

What is the result?

A. 0

B. 2

C. 4

D. 6

E. 9

F. 13

Answer: D


 

QUESTION NO: 66

Given:

1. class A {

2. }

3. class Alpha {

4. private A myA = new A();

5.

6. void dolt( A a ) {

7. a = null;

8. }

9. void tryIt() {

10. dolt( myA );

11. }

12. }

Which two statements are correct? (Choose two)

A. There are no instanced of A that will become eligible for garbage collection.

B. Explicitly setting myA to null marks that instance to be eligible for garbage collection.

C. Any call on tryIt() causes the private instance of A to be marked for garbage

collection.

D. Private instances of A become eligible for garbage collection when instances of Alpha

become eligible for garbage collection.

Answer: B, D

9 comments:

Anonymous said...

Question 1 is wrong answer Compilation fail answer should be D. Syntax of main is wrong!

Anonymous said...

I mean to QUESTION NO: 60

Unknown said...

Can you please post SCJP1.6 dumps.

Anonymous said...

can u please post me scjp1.6 dumps to kiranmaireddy2009@yahoo.com

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.

nokia pc suit said...

can u please post me scjp1.6 dumps to rahulk.singhal86@gmail.com

Anonymous said...

please post me scjp 1.6 dumps mugali.jagadish@gmail.com

Anonymous said...

Plz mail me ocpjp dumbs on viru.nalawade@gmail.com

Unknown said...

Plz mail me ocpjp dmps on sudipsaha.ab@gmail.com

Post a Comment