SCJP 5.0(75%), SCWCD 5.0(88%)
Cheers, Roberto Perillo
SCJP, SCWCD, SCJD, SCBCD
Originally posted by Campbell Ritchie:
Jesper Young is correct.
There is no point confusing things by changing < to >=, you have to stick with what the question said. Not as if you had actually got the < and >= the right way round.![]()
Cheers, Roberto Perillo
SCJP, SCWCD, SCJD, SCBCD
SCJP 5.0(75%), SCWCD 5.0(88%)
if (x>y) z=x; else z=y;
[A] z=x<y ? x:y
[B] z=x<y ?y : x
[c] z= y<x ?x :y
[D] z=y<x?y:x
A dreamer is one step behind the achiever, and the achiever was once a dreamer.
A dreamer is one step behind the achiever, and the achiever was once a dreamer.
A dreamer is one step behind the achiever, and the achiever was once a dreamer.
Originally posted by Dale Carnegie:
So z will have a reference to another object not like at the if statement.
Cheers, Roberto Perillo
SCJP, SCWCD, SCJD, SCBCD
Originally posted by Roberto Perillo:
Honestly, I think this exercise is wrong. None of the answers are correct.
The answers that get closer to be right are both B and C. The exercise assumes that the oposite of x>y is y<x, which is wrong. The oposite of x>y is y<=x. ...
Cheers, Roberto Perillo
SCJP, SCWCD, SCJD, SCBCD
Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]