对着书抄的简单代码,也错了!
3.
跟着书上抄的还出现错误,代码如下:
import Javax.swing.JOptionPane;
public class BreakLabelDemo {
public static void main (String args [])
{
String output="";
stop;
{
for (int row=1;row<=10;row++)
{
for (int column=1;column<=5;column++)
{
if (row==5)
break stop;
output+="* ";
}
output+="\n" ;
}
output+="\nLopps terminated normally";
}
JOptionPane.showMessageDialog (null,output,"Testing break with a label",JOptionPane.INFORMATION_MESSAGE);
System.exit (0);
}
}
错误信息:
D:\XX>javac BreakLabelDemo.java
BreakLabelDemo.java:6: 不是语句
stop;
^
1 错误
大哥们看看咋会错了!