帮我找下哪错了啊说是Exception in thread "main" java.lang.Error:Unresol
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/11/08 11:36:48
帮我找下哪错了啊说是Exception in thread "main" java.lang.Error:Unresolved compilation problem:
public class Week1 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int week=1;
System.out.println("week="+week+"");
Switch(week);
{
case0:System.out.println("Sunday");break;
case1:System.out.println("Monday");break;
case2:System.out.println("Tuesday");break;
case3:System.out.println("Wednesday");break;
case4:System.out.println("Thursday");break;
case5:System.out.println("Friday");break;
case6:System.out.println("Saturday");break;
default:System.out.println("Data Error!");
}
}
}
public class Week1 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int week=1;
System.out.println("week="+week+"");
Switch(week);
{
case0:System.out.println("Sunday");break;
case1:System.out.println("Monday");break;
case2:System.out.println("Tuesday");break;
case3:System.out.println("Wednesday");break;
case4:System.out.println("Thursday");break;
case5:System.out.println("Friday");break;
case6:System.out.println("Saturday");break;
default:System.out.println("Data Error!");
}
}
}
可能是你的环境变量设置出了问题
重新安装下 重新设置变量
而且程序也编的有错误
switch 语句中switch要小写 JAVA对大小写敏感
case 1要空一格..否则无法识别
case 2
case 3
依此类推
重新安装下 重新设置变量
而且程序也编的有错误
switch 语句中switch要小写 JAVA对大小写敏感
case 1要空一格..否则无法识别
case 2
case 3
依此类推
帮我找下哪错了啊说是Exception in thread "main" java.lang.Error:Unresol
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsEx
Exception in thread "Thread-2" java.lang.NullPointerExceptio
Exception in thread "AWT-EventQueue-0" java.lang.StringIndex
Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexO
Exception in thread "main" java.sql.SQLException:用尽的 Results
Exception in thread "main" org.hibernate.HibernateException:
java.lang.Exception, java.lang.RuntimeException, java.lang.E
java.lang.ClassCastException: java.lang.Long
java.lang.NumberFormatException:null java.lang.NumberFormatE
java.lang.SecurityException是什么意思
java.lang.illegalstateexception