Java I/O 总结

  • 将标准输入的内容写入文件
  • Scanner in = new Scanner(System.in);FileWriter out = new FileWriter("systemIn.log");String s;while (!(s = in.nextLine()).equals("Q")){    out.write(s + "\n");}out.flush();out.close();in.close();