1 /*--------------------------------------------------------------------------*/ 2 /* File name : err11.java */ 3 /* : */ 4 /* Cause : If I declare both array which have more than 10 element */ 5 /* : and switch statement, make error. */ 6 /* : */ 7 /* Message : err11.java:1: Missing class name. */ 8 /* : public class err11 */ 9 /* : ^ */ 10 /* : err11.java:1: Class or interface declaration expected. */ 11 /* : public class err11 */ 12 /* : ^ */ 13 /* : 2 errors */ 14 /*--------------------------------------------------------------------------*/ 15 16 public class err11 17 { main(String args[])18 public static void main(String args[]) 19 { 20 int i; 21 short ary1[] = {12,23,34,45,56,67,78,89,90,111}; 22 23 for(i=0; i<10; i++) { 24 switch(ary1[i]) { 25 case 111 : System.out.println("OK"); 26 default : break; 27 } 28 } 29 } 30 } 31