帮我找下哪错了啊说是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 stubint week=1;System.out.println("wee
来源:学生作业帮助网 编辑:六六作业网 时间:2025/01/24 11:38:57
帮我找下哪错了啊说是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 stubint week=1;System.out.println("wee
帮我找下哪错了啊说是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!");
}
}
}
帮我找下哪错了啊说是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 stubint week=1;System.out.println("wee
可能是你的环境变量设置出了问题
重新安装下 重新设置变量
而且程序也编的有错误
switch 语句中switch要小写 JAVA对大小写敏感
case 1要空一格..否则无法识别
case 2
case 3
依此类推
类别类别~~
你应该放在“电脑”里面的类别问。。。
public class week1 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int week=1;
System.out.println("week="+w...
全部展开
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){
case 0: System.out.println("Sunday");break;
case 1: System.out.println("Monday");break;
case 2: System.out.println("Tuesday");break;
case 3: System.out.println("Wednesday");break;
case 4: System.out.println("Thursday");break;
case 5: System.out.println("Friday");break;
case 6: System.out.println("Saturday");break;
default: System.out.println("Data Error!");
}
}
}
同学,基础知识错误啊,看来刚学JAVA吧。上面这个是我给你修改后可运行程序,自己对比不同吧
收起