?? policyexample.java
字號(hào):
import java.io.File;
import java.io.FileOutputStream;
//訪問(wèn)權(quán)限的控制
public class PolicyExample {
public static void main(String[] args){
try{
//寫一個(gè)文件到c:/hello.txt
byte[] info = "Hello,這是測(cè)試信息".getBytes(); //定義寫到文件的信息
File testFile = new File("c:/hello.txt"); //定義文件,輸出到c:/hello.txt
FileOutputStream fout = new FileOutputStream(testFile);
fout.write(info); //寫信息到文件
fout.close(); //關(guān)閉輸出流
System.out.println(testFile.getAbsolutePath() + " 寫入成功");
}catch (Exception ex){
ex.printStackTrace();
}
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -