Published
- 1 min read
how to use ? in java without using if
The solution for this is noted below
how to use ? in java without using if
Solution
switch( CONDITION ? 1 : 0 )
{
case 1:
//... true code
break;
case 0:
//... false code
break;
}
Try other methods by searching on the site. That is if this doesn’t work