what does question mark mean in java

Solutions on MaxInterview for what does question mark mean in java by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "what does question mark mean in java"
Jake
07 Aug 2016
1boolean statement ? true result : false result;
2
3/*
4For example, if we take this if statement:
5*/
6if (a > b) {
7    result = x;
8} else {
9    result = y;
10}
11// can be also writen:
12result = a > b ? x : y;