⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 write2file.java~4~

📁 手机端游戏开发程序
💻 JAVA~4~
字号:
package chess;
import java.io.*;
/**
 * 写文件
 * @param fileName 文件名
 * @param s
 * @throws Exception
 */
public class Write2File {
  public void Write2File(String fileName, String s) { //throws Exception
    FileWriter out = null;
    try {
      out = new FileWriter(fileName, true);
      out.write(s);
      out.write("\r\n");
      out.close();
    }
    catch (Exception e) {
      System.out.println(e.getMessage());
    }
    finally {
      try {
        if (out != null) {
          out.close();
        }
      }
      catch (Exception e2) {
        System.out.println(e2.getMessage());
      }
    }
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -