Translate

Showing posts with label Conditional operators in java. Show all posts
Showing posts with label Conditional operators in java. Show all posts

Friday, 15 August 2014

Conditional operators in java

? and : are conditional operators in java. They are used as shown below.
variable = (boolean expression) ? true part : false part

e.g
c=  ( a>b ) ? a : b;

It means 
if (a>b)
    c =a;
else
    c=b;

Total Pageviews