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
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply 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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: About Ternary operator
 
Similar Threads
String concatenation
:?
Clarification about Ternary operator
can any one explain this
Syntax error for ternary operator