[求助] 那位大虾帮我看一下我的代码错在哪里?
//ILoveJava.java
import javax.swing.JOptionPane;
class ILoveJava
{
public static void main(String arg[])
{
HelloWorld hello = new HelloWorld();
String response;
// response = JOptionPane.showInputDialog
// ("who is your favorite guy?");
JOptionPane.showMessageDialog(null,hello.response+" is a good guy.\n");
System.exit(0);
}
}
//HelloWorld.java
import javax.swing.JOptionPane;
class HelloWorld
{
String response;
response = JOptionPane.showInputDialog("Input the name:\n"); //本行有错?
}