📄 ex6_11.java
字号:
//Ex6_11import java.io.*;class Ex6_11{public static void main ( String[] args ) { String fileName = "c:/data1.dat" ; long sum = 0; try { DataInputStream instr = new DataInputStream( new BufferedInputStream(new FileInputStream(fileName))); try { while ( true ) sum += instr.readInt(); } catch ( EOFException eof ) { System.out.println( "The sum is: " + sum ); instr.close(); } } catch ( IOException iox ) { System.out.println("IO Problems with " + fileName ); } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -