Last change
on this file was 2, checked in by bird, 22 years ago |
Initial revision
|
-
Property cvs2svn:cvs-rev
set to
1.1
-
Property svn:eol-style
set to
native
-
Property svn:executable
set to
*
|
File size:
1.3 KB
|
Line | |
---|
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 | {
|
---|
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 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.