Friday, 14 September 2012

Java program codes: 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:

Post a Comment