aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes q from sun's epractice exam Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "q from sun Watch "q from sun New topic
Author

q from sun's epractice exam

JayaSiji Gopal
Ranch Hand

Joined: Sep 27, 2004
Posts: 303


wht is the result?
What is the result?





A
x = 0
B
x = 1
C
x = 2
D
x = 3
E
x = 4
F
Compilation fails

i answered x = 2. but the correct answer is x=4
i answered x=2, bcos b=false sets the value of b to false.so,doesnt the if loop return true?
plz explain.


SCJP 1.4, SCWCD 1.4<br /> <br />Thanks in advance!<br />Jayashree.
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
"b=false sets the value of b to false"
You are correct, but what is the value of the expression ?


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
 
jQuery in Action, 2nd edition
 
subject: q from sun's epractice exam