ch8ex81.java
来自「JAVA程序设计 丁岳伟 彭敦陆编 高等教育出版社 第7---11章程序」· Java 代码 · 共 18 行
JAVA
18 行
import java.io.*;
public class ch8ex81{
public static void main(String[]args){
try{
DataOutputStream fout=new DataOutputStream(new FileOutputStream("ch8ex8.dat"));
for(int j=0;j<10;j++){
fout.writeInt(j);
fout.writeChar((char)(j+65));
fout.writeDouble(j*12.5);
fout.writeBoolean(true);
fout.writeUTF("The example for DataOutputStream class");
}
fout.close();
}catch(Exception e){
e.printStackTrace();
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?