java初学者求助,提示非法的表达式开始
请麻烦帮我看看哪里出错了,老是在编译的时候提示非法的表达式开始class7{publicstaticvoidmain(String[]args){intx=10;Stri...
请麻烦帮我看看哪里出错了,老是在编译的时候提示非法的表达式开始
class 7{
public static void main (String[] args) {
int x = 10;
String word ="JACK";
while (x>0);
{
if (x == 1)
{
word ="JACK";
}
System.out.println(x+""+word+"quit job");
System.out.println(x+""+word+"very good");
x = x - 1;
if (x>0)
{
System.out.println(x+""+word+"quit job");
}else{
System.out.println("it is done");
}
}
}
}
}
十分感谢哈 展开
class 7{
public static void main (String[] args) {
int x = 10;
String word ="JACK";
while (x>0);
{
if (x == 1)
{
word ="JACK";
}
System.out.println(x+""+word+"quit job");
System.out.println(x+""+word+"very good");
x = x - 1;
if (x>0)
{
System.out.println(x+""+word+"quit job");
}else{
System.out.println("it is done");
}
}
}
}
}
十分感谢哈 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询