Java/Excercise

javaio ch02 FileInputStreamTest3

낭구리 2021. 9. 13. 17:52
package ch02;

import java.io.FileInputStream;

public class FileInputStreamTest3 {

	public static void main(String[] args) {
		try(FileInputStream fis = new FileInputStream("assets/input.txt")){
			int i ;
			while((i=fis.read())!= -1) {
				System.out.println((char)i);
			}
		}catch (Exception e) {
			System.out.println(e);
		}//auto close 기능이 자동으로 탑재

	}

}

 

 

'Java > Excercise' 카테고리의 다른 글

javaio ch02 FileInputStreamTest5  (0) 2021.09.13
javaio ch02 FileInputStreamTest4  (0) 2021.09.13
javaio ch02 FileInputStreamTest2  (0) 2021.09.13
javaio ch02 FileInputStreamTest1  (0) 2021.09.13
javaio ch01 SysteminTest  (0) 2021.09.13