JAVA DUMPS 6(SCJP)

QUESTION NO: 29


Given:

1. public class Foo {

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

3. try {

4. return;

5. } finally {

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

7. }

8. }

9. }


What is the result?

A. Finally

B. Compilation fails.

C. The code runs with no output.

D. An exception is thrown at runtime.


Answer: A


QUESTION NO: 30


Given:

ClassOne.java:

1. package com.abe.pkg1;

2. public class ClassOne {

3. private char var = 'a';

4. char getVar() { return var; }

5. }

ClassTest.java:

1. package com.abe.pkg2;

2. import com.abc.pkg1.ClassOne;

3. public class ClassTest extends ClassOne {

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

5. char a = new ClassOne().getVar();

6. char b = new ClassTest().getVar();

7. }

8. }


What is the result?

A. Compilation fails.

B. Compilation succeeds and no exceptions are thrown.

C. An exception is thrown at line 5 in ClassTest.java.

D. An exception is thrown at line 6 in ClassTest.java.


Answer: A


QUESTION NO: 31


Given:

1. public class Alpha1 {

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

3. boolean flag; int i=0;

5. do {

6. flag = false;

7. System.out.println( i++ );

8. flag = i < 10;

9. continue;

10. } while ( (flag)? true:false );

11. }

12. }


What is the result?

A. 000000000

B. 0123456789

C. Compilation fails.

D. The code runs with no output.

E. The code enters an infinite loop.

F. An exception is thrown at runtime.


Answer: B


QUESTION NO: 32


Given:

1. package foo;

2.

3. import java.util.Vector;

4.

5. protected class MyVector Vector {

6. init i = 1;

7. public MyVector() {

8. i = 2;

9. }

10. }

11.

12. public class MyNewVector extends MyVector {

13. public MyNewVector() {

14. i = 4;

15. }

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

17. MyVector v = new MyNewVector();

18. }

19. }


What is the result?

A. Compilation succeeds.

B. Compilation fails because of an error at line 5.

C. Compilation fails because of an error at line 6.

D. Compilation fails because of an error at line 14.

E. Compilation fails because of an error at line 17.


Answer: B

36 comments:

Anonymous said...

Just following a few steps even you may get 100% in SCJP

gowtham said...

Answer for the last question(32) is wrong. You can sub class/inherit a protected class from another package. I fails to compile as i is a default variable and it not accesible by MyNewVector class. So the answer is D.

Anonymous said...

@ Gowtham
I think, the answer for Q. 32 is B rather than D coz, A class cannot have "Protected" as access nodifier. Protected is valid only for class members. This would be the first fault the compiler would see.
Or would the Compiler let it go with a warning?? Need to check...

Anonymous said...

hello..its B only for Q 32 as there is a white space between this class name MyVector Vector

I would go for answer B for Q 32.

- Regards,
Babu

Anonymous said...

I think at line 5 we have return type for that class but nothing is being returned. It will throw compilation error. Answer B

java1246 said...

Hi guys, answer to question no : 32 is 'B' because a class cannot have protected or private access specifiers.

Anonymous said...

ya guys , the answer B is correct.......

Anonymous said...

answer of wuestion number 32 is right, b'coz you can't declare the top level classes as a protected. only two visibility mode is available for top level classes i.e public and package level modifiers.

Anonymous said...

watch out more new dumps here SCJP New Dumps

Anonymous said...

Thanks for the share ..Really appreciated work. All your blog need is to have good PR. And I do have the SCJP Dumps | SCWCD Dumps...I think this is helpful to ur visitors

Unknown said...

B option is definitely correct one, cauz out of 4 access levels ie.default, public, private and protected. only default and public
is allowed to declare for a class.

gaurav said...

Bosdi ke B is right

Aswini said...

The option is B bcoz protected modifier is not applicable for top-level classes like MyVector class . Hence, compilation error at line 5

Vinayak said...

The Option B is right, because there is whitespace between the class name.

Unknown said...

32 Answer is wrong at the time of obj creation MyNewVector() is called.The control entered into that class Here the variable i=4 is initialized that extends from MyVector() but it is of type protected. We con't access i so error will be at line 14.So Ans D is correct

swap said...

The answer to Q32 is B because outer class can only be either public or default.so applying protected modifier to class will give compile time error.

ankit srivastava said...
This comment has been removed by the author.
Anonymous said...

Hi please send me scjp6 dumps. my mail id is lp_srivi@yahoo.co.in

Anonymous said...

Anonymous said...
I think at line 5 we have return type for that class but nothing is being returned. It will throw compilation error. Answer B

July 8, 2009 12:11 AM


I had never heard about return type of a java class.

Anonymous said...

I have a query. Why O?P of quest 30 is A. I think it should compile properly. It is a very straight forward question.

rakesh said...

Could anyone please send me the dumps for SCJP on my email ID
rak.nik1@gmail.com ?
Thanks in advance....!!

Mohammed Sikander said...

Hi, Please send me the SCJP6 dumps to my mail id sikander_048@yahoo.co.in

Anonymous said...

COuld anyone please send me the dumps for the latest SCJP 6 exam? janani.m.06@gmail.com

Harsh said...

guys , guys , guys.. relax. you know the answer, its great that you know the answers. keep them in your mind, try it on your PC. check it and verify.. two or three comments are enough to tell somethings wrong. why u all people making it so ugly?? nice and easy.. relax. chill.. have a couple of beer's and take care.. :) ;)

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.

your way said...

I took training in a institute for passing the exam and took scjp6 using these dumps and got 93% marks. Not to mention all questions are from them. These can be really relevant if you are looking forward to get good marks. If anybody want them mail me at mp7504@gmail.com. I am giving them for 300rs, its not a freebie material.

Unknown said...

download updated java dumps from http://allitcert.blogspot.in

Anonymous said...

please send me latest scjp dumps am writing exam in october 2012 my mail id shalinichowdhary55@yahoo.com

Anonymous said...

Nice post.. Check our latest Latest SCJP 6 Dumps here

OCJPFORUM said...

Latest OCJP6 Facebook Updates on

https://www.facebook.com/OCJPFORUM

OCJPFORUM said...

OCJP6 Dumps Download see this

http://ocjpforum.blogspot.in/

Unknown said...

A must read :
" Best way to prepare for OCPJP exam "

http://www.bubblews.com/news/807922-best-way-to-prepare-for-java-ocpjp67-exam

http://www.facebook.com/pages/Java-Tutorials/255897777881483?fref=ts

Unknown said...

Plz mail me the latest scjp6 dumps at saloni7.dangwal@yahoo.in

Unknown said...

Plz mail me the latest scjp6 dumps at saloni7.dangwal@yahoo.in

hemanth said...

Please mail me latest OCJp 6 dumps at hemanthm55@gmail.com
thanks in advance

Anonymous said...

hey,
in question no 31 i didnt get how he write flag = i < 10; how is it possible ...can anyone pls explain this program

Post a Comment