+ 2

Can i write else if only if in java.

e.g if(x==3) { System.out.println(3); } if(x==4) { System.out.println(4); } else if (x==5) { System.out.println(5); } What can I write else if only if.

12th Jun 2018, 5:46 PM
Maninder $ingh
Maninder $ingh - avatar
1 Réponse
0
Maybe you want this? if(x>=3 && x<=5){ System.out.println(x) }
12th Jun 2018, 8:08 PM
KrOW
KrOW - avatar