早教吧作业答案频道 -->其他-->
求错。总是无法编译出.class文件publicclassweather2{publicstaticvoidmain(String[]args){intx=8;switch(x){case3:case4:case5:System.out.println(x+"ThisisSpring.");break;case6:case
题目详情
求错。总是无法编译出.class 文件
public class weather2
{
public static void main(String[]args)
{
int x = 8;
switch (x)
{
case 3:
case 4:
case 5:
System.out.println(x+"This is Spring.");
break;
case 6:
case 7:
case 8:
System.out.println(x+"This is Summer.");
break;
case 9:
case 10:
case 11:
System.out.println(x+"This is Autumn.");
break;
case 12:
case 1:
case 2:
System.out.println(x+"This is Winner.");
default:
System.out.println(x+"None.");
break;
}
}
}
public class weather2
{
public static void main(String[]args)
{
int x = 8;
switch (x)
{
case 3:
case 4:
case 5:
System.out.println(x+"This is Spring.");
break;
case 6:
case 7:
case 8:
System.out.println(x+"This is Summer.");
break;
case 9:
case 10:
case 11:
System.out.println(x+"This is Autumn.");
break;
case 12:
case 1:
case 2:
System.out.println(x+"This is Winner.");
default:
System.out.println(x+"None.");
break;
}
}
}
▼优质解答
答案和解析
自己对比吧-------------------------把你的复制的确不行!!!我重写了一遍但是没有发现错误!代码一样哦
public class weather2 {
public static void main(String[] args) {
int x = 8;
switch (x) // 用switch实现多分支语句
{
case 3:
case 4:
case 5:
System.out.println(x + "This is Spring.");
break;
case 6:
case 7:
case 8:
System.out.println(x + "This is Summer.");
break;
case 9:
case 10:
case 11:
System.out.println(x + "This is Autumn.");
break;
case 12:
case 1:
case 2:
System.out.println(x + "This is Winner.");
default:
System.out.println(x + "None.");
break;
}
}
}
public class weather2 {
public static void main(String[] args) {
int x = 8;
switch (x) // 用switch实现多分支语句
{
case 3:
case 4:
case 5:
System.out.println(x + "This is Spring.");
break;
case 6:
case 7:
case 8:
System.out.println(x + "This is Summer.");
break;
case 9:
case 10:
case 11:
System.out.println(x + "This is Autumn.");
break;
case 12:
case 1:
case 2:
System.out.println(x + "This is Winner.");
default:
System.out.println(x + "None.");
break;
}
}
}
看了 求错。总是无法编译出.cla...的网友还看了以下:
用这些英文字母拼词这些英文字母打乱了顺序.一个题目一个词.第一题:r,c,t,a,e,s,r第二题 2020-05-16 …
货币的交易需求可由( )函数关系表达。A.L=f(p)B.L=f(r)C.L=f(y)D.L=f(y 2020-05-30 …
求教大学物理题!一带电圆柱面半径为R,长为L,沿轴向单位长度带电量为X,在圆柱面外有一点P,距圆柱 2020-07-05 …
已知面a,b,r,满足a垂直于r,b垂直于r,a交b=l,求证:l垂直于r已知面a,b,r,满足a 2020-07-12 …
英语单词填空1.时间状语:d-r-n-2.场所:b-s-s-o-f-r--e-a-t-e-t3.教 2020-07-14 …
概率统计问题,急,推广的二项系数公式(-r,L)=(-1)^L(r+L-1,L)怎么得来的?∞∑( 2020-07-30 …
想在matlab里面实现,已知S和R的关系,见'补充'.L已知,S自变量,R因变量,想根据S的值计 2020-08-01 …
化学平衡中的气、液、固三系是否分开讨论…?比如,mA(g)+nB(l)=pC(g)+qD(l)+rE 2020-11-03 …
由国名的每个字母想到的一句话例:Italy转化为:Itrustandloveyou.(我相信你并且爱 2020-11-23 …
己知平面a,b,r满足a丄r,b丄r,anb=l,求证:l丄r?(画图) 2021-01-12 …