//不许转换,直接写
Scanner scanner = new Scanner(System.in);
String str = scanner.nextLine();
FileWriter fw=new FileWriter("D:/abc.txt");
fw.write(str);
fw.close();
Scanner scanner = new Scanner(System.in); String str = scanner.nextLine();File file = new File("1.txt");if(!file.exists()){ file.createNewFile(); }
有下面完整的类,很完整,但不是很清晰,我有源代码的java文件,可以向我发个邮件,邮箱是757957762@qq.com,希望采纳!!!