Compiler Error J0090

'default' has already been defined in switch statement

The compiler identified two or more instances of the keyword default occurring within the same switch statement.

The following example illustrates this error:

public class Simple {
   
   public int method1(int arg1) {
   
      switch (arg1) {
         case 1:
            return (int) 1;
         case 2:
            return (int) 2;
         default:
            return (int) 3;
         default: // error: duplicate of above
            return (int) 0;
      }
   }
}