I think these program can take shepard as arguments , so the comilation err

publicclass Test{

publicenum Dogs{collie, harrier, shepherd};

publicstaticvoid main(String args[])

{

Dogs myDog = Dogs.shepherd;

switch(myDog){

case collie:

System.out.print("collie ");

case harrier:

System.out.println("harrier ");

casedefault:

System.out.println("retriever ");

}

}

}

Output

D:\PCKG>javac Test.java

Test.java:11: illegal start of expressio

case default:

^

Test.java:12: : expected

System.out.println("retriever ");

2 errors^

[1272 byte] By [Tatona] at [2007-10-3 3:05:10]
# 1
The syntax for the default clause is simply 'default', not 'case default'.kind regards,Jos
JosAHa at 2007-7-14 20:55:15 > top of Java-index,Java Essentials,New To Java...
# 2
You have "case default". It should be just "default".
Lokoa at 2007-7-14 20:55:15 > top of Java-index,Java Essentials,New To Java...