Orphaned Case Error in Java

You ran into multiple problems here.

Problem 1 :

 Switch (id); {

 ----------^

Look carefully your ; ends your switch there right away.

Apparently all your case statements became orphans 🙂

Problem 2 :

Your Switch should be switch(lower case s)

Problem 3 :

One more ; cause you compile time error at the line

public static void main(String []args); {


                                 -----^

Note: I strongly suggest you to use an IDE, to save lot of time here. It tells you the compiler errors on the fly.

Leave a Comment