[Solved] JAVA: what does this symbols means: ‘>=’, ‘?’ and ‘:’? [closed]


this.size = size >= MIN_SIZE ? size : MIN_SIZE;

is the shortcut for

 if (size >= MIN_SIZE){
      this.size = size; //i.e. keep it.
 }else{
     this.size = MIN_SIZE;
 }

Or in generic speech:

value = (condition)? optionA : optionB;

equals

if (condition){
   value = optionA;
}else{
   value = optionB;
}

6

solved JAVA: what does this symbols means: ‘>=’, ‘?’ and ‘:’? [closed]