Convert the following if else if construct into switch case:
if(var==1)
System.out.println(“Good”);
else if(var(==2)
System.out.println(“Better”);
else
System.out.println(“Best”);
Answers
Answered by
2
Explanation:
Convert the following if else if construct into switch case if (var= = 1) System.out .println(“good”); else if(var= =2) System.out.prindn(“better”); ...
Top answer · 1 vote
switch ( ) { case 1: System.out .println( “good”); break; . case 2: System.out .println( “better”); break; case 3: System.out.println( ...
Answered by
0
Answer:
This is your answer that you required.
This answer belongs switch case statement.
HOPE IT HELPS YOU.
THANK U ALL.
Attachments:
Similar questions