?? writefiledemo.java
字號:
import java.io.*;
public class WriteFileDemo
{
public static void main(String arg[]) throws IOException
{
byte[] somebyte = {'a','b','c'};
String hello = "hello";
FileOutputStream out = new FileOutputStream("data.tmp");
if ( out != null )
{
System.out.println( "Begin to write to file" );
out.write( somebyte );
String str = new String( somebyte,0 );
System.out.println( "write bytes:" + somebyte + " or write string:"+str );
for ( int i = 0;i<hello.length();i++ )
out.write( hello.charAt(i) );
System.out.println( "write the string hello:" + hello );
out.close();
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -