This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills and have John Sonmez on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes About Ternary operator Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "About Ternary operator" Watch "About Ternary operator" New topic
Author

About Ternary operator

Richard Wilson
Ranch Hand

Joined: Jan 12, 2002
Posts: 57
Hi,can anyone tell whether the Ternary operator
(?: ) does a full evaluation or a partial evaluation to the operands.
[ February 10, 2002: Message edited by: Richard Wilson ]

Richard Wilson
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
The following link may be of help:
JLS 15.25 Conditional Operator ? :
Amazing how a simple piece of code can be of tremendous help

Output: 10,2,3,40
which means only the relevant operand is evaluated
HIH
[ February 10, 2002: Message edited by: Valentin Crettaz ]

SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: About Ternary operator