-1
import javax.swing.*;
import java.io.File;
public class Third {
public static void main(String[] args) throws Exception {
String humanName;
humanName = JOptionPane.showInputDialog(null, "Enter the file name");
File file = new File(+ humanName".txt");
System.out.println(file.delete());
JOptionPane.showMessageDialog(null, "File deleted" + humanName);
}
}
什么是错误? – 2010-05-06 09:34:30
File file = new File(+ humanName“.txt”); 卡在这里,它假设读取我的输入并删除文件我wan to – user334101 2010-05-06 09:35:54