File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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
 
Similar Threads
:?
can any one explain this
String concatenation
Syntax error for ternary operator
Clarification about Ternary operator