写入一个简单的文件
import java.io.IOException; import java.nio.file.Files;/*nowjava - 时 代 Java 提 供*/ import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.StandardOpenOption; public class Main { public static void main(String[] args) throws IOException { Path newPath = Paths.get("/home/docs/newUsers.txt"); byte[] newContents = "Christopher".getBytes(); Files.write(newPath, newContents,