Friday, November 23, 2012

The ? : operator in Java


if (a > b) {
  max = a;
}
else {
  max = b;
}

or shortly

max = (a > b) ? a : b;

http://www.cafeaulait.org/course/week2/43.html

No comments:

Post a Comment