Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Help Java J Java Questionmark operator

Related Tutorials


 
 

Share on Google+Share on Google+

Java Questionmark operator

Advertisement
The only ternary (i.e. takes three values) operator in Java is the conditional operator.

Java Questionmark operator 

     

The only ternary (i.e. takes three values) operator in Java is the conditional operator

Syntax:

boolean-expression ? result-if-true : result-if-false


This operator returns one of two values depending on a third value:

Here a question mark and colon separate the three parts of the operator.

To know more about ternary operator

http:/www.roseindia.net/java/master-java/conditional-operators.shtml



Advertisements

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: November 13, 2009

Related Tutorials

Discuss: Java Questionmark operator  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0
DMCA.com