• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

SCJP 6, 15.04.2010 12:30 CET

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
After two months of hard preparations I'm finally taking SCJP 6.0 exam tomorrow at 12:30 CET. I feel strong, but still a bit nervous about unlucky questions and stuff Wish me luck!!
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Best of luck for tomorrow! I have mine tomorrow also! How are you scoring on mocks? Have you done the Master exam from K & B?
 
Ranch Hand
Posts: 310
1
Oracle Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Phillip Wells wrote:Best of luck for tomorrow! I have mine tomorrow also! How are you scoring on mocks? Have you done the Master exam from K & B?



wish you both all the best and good luck!
take care
 
Mana Lesar
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Phillip Wells wrote:How are you scoring on mocks? Have you done the Master exam from K & B?


On Master Exam from K & B I score 76% average, though i haven't done any other mocks apart from K&B.

wish you both all the best and good luck!
take care


Thanks
 
Sheriff
Posts: 9708
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Best of luck for your exam, we hope your hard work will pay out
 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Best of luck for you both :)
 
Ranch Hand
Posts: 247
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Good luck and be sure to:

1. Get a good night's sleep tonight, i.e. more than 6 hours of bedtime. (The test questions seem a lot easier when you are fully rested.)
2. Be at the testing center 30 minutes before the start of the exam (time is needed to empty all your pockets and complete some paperwork).
 
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
All the best to both of you
 
Ranch Hand
Posts: 774
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Larry Chung wrote:Good luck and be sure to:

1. Get a good night's sleep tonight, i.e. more than 6 hours of bedtime. (The test questions seem a lot easier when you are fully rested.)
2. Be at the testing center 30 minutes before the start of the exam (time is needed to empty all your pockets and complete some paperwork).



Larry is correct.

Anyhow best of luck and we will be waiting for a good news definitely.

Good luck,
 
Ranch Hand
Posts: 317
Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Best of luck for your exam
 
Mana Lesar
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
PASSED: 91 %

What do I want to say is that SOME of the questions were REALLY tricky, definitely harder than what did I see at K&B Master Exam. It was as like SUN thought: "Ha! We know that you read K&B book/Master Exams and notice a trap here, but we will be smarter, we will put a trap in the trap and then another one in the last one!" . Still, the great advantage on the exam is that you always know how many answers are correct.
Anyway I'm glad with my score and after some break gonna start preparing for SCWCD Thank you for all the tips I found on this forum
See You All on the SCWCD forum soon
 
Prithvi Sehgal
Ranch Hand
Posts: 774
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Great score Mana.

Congratulations.

 
Larry Chung
Ranch Hand
Posts: 247
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Congratulations on a great score.

By next week or sooner, you will receive 2 e-mails from Sun. One e-mail will give you your Sun Certification ID and information on how to register for the Certification Database. If you do not get that e-mail, send a message to who2contact@sun.com to ask about it.

Two to three weeks (or longer if you are not in the U.S.) after you register into the Certificate Database, you will receive in the postal mail a welcome kit containing your SCJP certificate and a small plastic wallet-size ID card that indicates your SCJP status. If you do not get that package then send a message to who2contact@sun.com to ask about it.
 
Mana Lesar
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One Tip for future SCJP takers...
If you got some time left after answering all questions, its not always good move to go back and think too much about all the questions you had already answered. I did that mistake and went through some questions again and all 2 changes that I made were from correct answers into wrong ones... After completing all questions you are probably mentally tired, and first thoughts are usally best ones
I have figured out 4 questions I got wrong on the exam out of 5 total.

One which I think is tricky i put here. There was a dozed or so lines of code given but these were crucial for me:



I was thinking hard if it is Compilation Error on line 3 because statement on line 3 is unreachable, as I knew that it is like that for following code samples:





Both above do not compile cause statement on line 3 is unreachable. The difference is that in above 2 samples, compiler can know just from first look that lines 3 are unreachable, cause "while(true)" without break inside should go forever(or throw exception what would make line 3 unreachable anyway), and 2nd example is obvious. In my case it was obvious for me that line 3 will never execute, but will compiler see it too as it was in above examples? In my question , compiler would have to go one step deeper into "if" condition statement which is always true, to see that exception is throwed. I decided that it will be compiller error, and i was wrong... If I think about it now it makes more sense for me and is rather obvious that there shouldn't be any compiler error, but it is all about your day shape and mental condition at THAT VERY moment, probably i was already tired after thinking hard on previous questions.

I went through many tough questiones, and easily got wrong on really lame ones, so the other 3 questions I got wrong I'm not gonna publish, cause they were so lame mistakes that i'm ashamed :P And the 5th one i don't know.
 
Rajeev Rnair
Ranch Hand
Posts: 310
1
Oracle Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
great score Mana!
Congrats!!!
 
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That is a great score. Congrats!!!



But I am still trying to understand why the compiler doesn't thrown an error for the above code, even though it knows for sure that if(true) is always going to be true and that the throw statement will always be executed. So what is the thing that makes the compiler allow this to compile fine? I am very curious to learn.
 
Rajeev Rnair
Ranch Hand
Posts: 310
1
Oracle Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Larry Olson wrote:That is a great score. Congrats!!!



But I am still trying to understand why the compiler doesn't thrown an error for the above code, even though it knows for sure that if(true) is always going to be true and that the throw statement will always be executed. So what is the thing that makes the compiler allow this to compile fine? I am very curious to learn.




is a compile-time error because the statement "System.out... "; is not reachable;


is a compile-time error because the statement "System.out... "; is not reachable;


compiles Fine!!



also compiles fine!!

what I found from enthuware is:
although the body of the condition is unreachable, this is not an error because the JLS explicity defines this as an exception to the rule. It allows this consturct to support optimizations through the conditional compilation. For example,
if(DEBUG){ System.out.println("beginning task 1"); }
Here, the DEBUG variable can be set to false in the code while generating the production version of the class file, which will allow the compiler to optimize the code by removing the whole if statement entirely from the class file.
 
Larry Olson
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the explanation. This is one of those Weird things that you will have to keep in mind as rules to the exception. It would be nice if rather some commonsense rule was used for all the code than creating exceptions , because now you have to try hard to remember these exceptions to the rule. It still beats me to understand the reason behind why JLS has been designed to allow this.

 
Rajeev Rnair
Ranch Hand
Posts: 310
1
Oracle Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Larry Olson wrote:Thanks for the explanation. This is one of those Weird things that you will have to keep in mind as rules to the exception. It would be nice if rather some commonsense rule was used for all the code than creating exceptions , because now you have to try hard to remember these exceptions to the rule. It still beats me to understand the reason behind why JLS has been designed to allow this.


Exactly! this really beats me why all these are allowed in JLS!
One thing is for sure , compiler is so happy with while(true){} things, but always suspicious at if(true) {} !!
this is too hard to remember anyways!
 
Ranch Hand
Posts: 446
1
Eclipse IDE MySQL Database Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
...
 
Larry Olson
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Prasad Kharkar wrote:this is because we can guarantee that while loop gets executed in any condition but about if statement, it will get executed only if the condition becomes true and not it every case
hence the compiler compiles it fine



If something else (say an expression) was inside the if condition then I agree with your explanation/logic. But in the case of "if (true)", it is absolutely clear that the condition is "true". So what you are saying doesn't make sense, since it is 100% clear that the condition will ALWAYS be true inside if(true). Think about it.
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mana stated that he averaged 76% on the K&B Master Exam and scored 91% on the actual exam. Those of you who took K&B Master Exam and then took the actual exam is it typical that you scored higher on the actual SCJP exam than the K&B Master Exam? I ask because i have scored at least 75% on each attempt with the K&B Master Exam but I have been doubting whether or not I am ready to take the SCJP exam.
 
Ankit Garg
Sheriff
Posts: 9708
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Congrats on the good score

Mana Lesar wrote:I did that mistake and went through some questions again and all 2 changes that I made were from correct answers into wrong ones...


How are you so sure about that?? Anyways, I was sure that I would do the same mistake when I gave my exam, so I used the comment box provided on each question. Like if I see that in a code the main method is declared main(String args), then I know that there will be an exception when the program is run. So I put this in the comment box so that on the next pass I don't have to go through the question all over again...
 
Mana Lesar
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ankit Garg wrote:Congrats on the good score

Mana Lesar wrote:I did that mistake and went through some questions again and all 2 changes that I made were from correct answers into wrong ones...


How are you so sure about that??



I remembered the questions I changed my answers, and on the way home was already quite sure i changed it for wrong. At home I checked it with the compiler and it turned out that indeed i changed to wrong
 
Sergio Rodrigo
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Congratulations, Mana.

Rajeev Rnair wrote:
what I found from enthuware is:
although the body of the condition is unreachable, this is not an error because the JLS explicity defines this as an exception to the rule. It allows this consturct to support optimizations through the conditional compilation. For example,
if(DEBUG){ System.out.println("beginning task 1"); }
Here, the DEBUG variable can be set to false in the code while generating the production version of the class file, which will allow the compiler to optimize the code by removing the whole if statement entirely from the class file.



It's right, but let's have a look at this code:



In this case, the compiler knows that y = x; and the next line is going to be executed, so it doesn't complain because y might not have been initialized. I don't understand the difference between this exemple and the if(true) throw new RuntimeException(); ones. Both examples should work..

Best regards.
 
Larry Olson
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

1. int y;
2. int x = 4;
3. if (true) y = x;
4. y++;



Hi Sergio,

I completely agree with you. You have given a perfect example of how if(true) behaves differently in different scenarios. i.e. the compiler seems to acknowledge the fact that if(true) will always be executed in the above code, since it doesn't complain about y not being initialized, whereas it seems to ignore the fact that if(true) will be executed in the below code, since it doesn't complain about the statement after the exception being unreachable. Two if(true) statements, but contradicting behavior by the compiler.


Contradicting behavior that is perplexing. Could experts share their thoughts on this?
 
This tiny ad is wafer thin:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic