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

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;