Friday, 9 September 2011

java Ternary operator example ?:

class BigNo
{
public static void main (String args[])
{

int a = Integer.parseInt(args[0]);

int b = Integer.parseInt(args[1]);

int c = Integer.parseInt(args[2]);

int x = (a>b)?(a>c?a:c):(b>c?b:c);

System.out.println(+x);
}
}
                                                           click image shown below  to enlarge


No comments: