Home Help Java J Java Questionmark operator



Java Questionmark operator
Posted on: November 13, 2009 at 12:00 AM
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



Related Tags for Java Questionmark operator :


More Tutorials from this section

Ask Questions?    Discuss: Java Questionmark operator  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.