exceptiontest5.java

来自「Java就业的培训教程书籍」· Java 代码 · 共 20 行

JAVA
20
字号
import java.io.*;
public class ExceptionTest5{
	public static void main(String args[]){
		FileInputStream fileObj = null;
		try{
			fileObj = new FileInputStream("readme.txt");
			System.out.println("Content of readme.txt is:");
			int Len,i =1;
			while((Len = fileObj.read())!=-1){
				System.out.print("Line "+i+Len);
				i = i+1;
			}
		}catch(IOException e){
			System.out.println(e);
		}catch(FileNotFoundException e){
			System.out.println(e);
		}
	}					
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?