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
JAVA DUMPS 6(SCJP)
Posted by gautam at Wednesday, November 14, 2007
Subscribe to:
Post Comments (Atom)
36 comments:
Just following a few steps even you may get 100% in SCJP
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.
@ 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...
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
I think at line 5 we have return type for that class but nothing is being returned. It will throw compilation error. Answer B
Hi guys, answer to question no : 32 is 'B' because a class cannot have protected or private access specifiers.
ya guys , the answer B is correct.......
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.
watch out more new dumps here SCJP New Dumps
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
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.
Bosdi ke B is right
The option is B bcoz protected modifier is not applicable for top-level classes like MyVector class . Hence, compilation error at line 5
The Option B is right, because there is whitespace between the class name.
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
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.
Hi please send me scjp6 dumps. my mail id is lp_srivi@yahoo.co.in
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.
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.
Could anyone please send me the dumps for SCJP on my email ID
rak.nik1@gmail.com ?
Thanks in advance....!!
Hi, Please send me the SCJP6 dumps to my mail id sikander_048@yahoo.co.in
COuld anyone please send me the dumps for the latest SCJP 6 exam? janani.m.06@gmail.com
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.. :) ;)
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.
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.
download updated java dumps from http://allitcert.blogspot.in
please send me latest scjp dumps am writing exam in october 2012 my mail id shalinichowdhary55@yahoo.com
Nice post.. Check our latest Latest SCJP 6 Dumps here
Latest OCJP6 Facebook Updates on
https://www.facebook.com/OCJPFORUM
OCJP6 Dumps Download see this
http://ocjpforum.blogspot.in/
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
Plz mail me the latest scjp6 dumps at saloni7.dangwal@yahoo.in
Plz mail me the latest scjp6 dumps at saloni7.dangwal@yahoo.in
Please mail me latest OCJp 6 dumps at hemanthm55@gmail.com
thanks in advance
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