SCJP 6.0
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?
SCJP6, SCWCD5, OCP-JBCD5, OCE-JWSD6 OCE-JPAD6 , OCM-JEA5 1,OCM-JEA5 2,3,OCJP8 - Brainbench certifications: J2EE, Java2, Java2-NonGUI, JSP, SQL2000 Admin, SQL2000 Programming , Brainbench certified Java Programmer, Computer Programmer, Web Developer, Database Administrator
Phillip Wells wrote: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
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
SCJP 6 (90%)
Excuse my English, please
SCJP 6
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).
SCJP 6
SCJP6, SCWCD5, OCP-JBCD5, OCE-JWSD6 OCE-JPAD6 , OCM-JEA5 1,OCM-JEA5 2,3,OCJP8 - Brainbench certifications: J2EE, Java2, Java2-NonGUI, JSP, SQL2000 Admin, SQL2000 Programming , Brainbench certified Java Programmer, Computer Programmer, Web Developer, Database Administrator
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.
SCJP6, SCWCD5, OCP-JBCD5, OCE-JWSD6 OCE-JPAD6 , OCM-JEA5 1,OCM-JEA5 2,3,OCJP8 - Brainbench certifications: J2EE, Java2, Java2-NonGUI, JSP, SQL2000 Admin, SQL2000 Programming , Brainbench certified Java Programmer, Computer Programmer, Web Developer, Database Administrator
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.
SCJP6, SCWCD5, OCP-JBCD5, OCE-JWSD6 OCE-JPAD6 , OCM-JEA5 1,OCM-JEA5 2,3,OCJP8 - Brainbench certifications: J2EE, Java2, Java2-NonGUI, JSP, SQL2000 Admin, SQL2000 Programming , Brainbench certified Java Programmer, Computer Programmer, Web Developer, Database Administrator
SCJP 6 [86%], OCPWCD [84%], OCEJPAD [83%]
If you find any post useful, click the "plus one" sign on the right
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
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...
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
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??
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.
SCJP 6 (90%)
Excuse my English, please
1. int y;
2. int x = 4;
3. if (true) y = x;
4. y++;
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
|