程序:import javax.swing.JOptionPane;
public class Square
{
public static void main(String args[])
{
String s=JOptionPane.showInputDialog( " put Number:”);
int n=Integar.parselnt(s);
int nn=n*n;
JOptionPane.showMessageDialog(
null
s+“ square is:”+nn
"title:square"
JOptionPane.PLAIN_MESSAGE );
System.exit(0);
}
}
结果:E:\wuyj\pro\wu\Wu.java:11: ')' expected
s +"square is:"+nn
public class Square
{
public static void main(String args[])
{
String s=JOptionPane.showInputDialog( " put Number:”);
int n=Integar.parselnt(s);
int nn=n*n;
JOptionPane.showMessageDialog(
null
s+“ square is:”+nn
"title:square"
JOptionPane.PLAIN_MESSAGE );
System.exit(0);
}
}
结果:E:\wuyj\pro\wu\Wu.java:11: ')' expected
s +"square is:"+nn
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货