Ex11_5 코드

package org.javaro.lecture; import java.io.*; public class Ex11_5 { public static void main(String[] args) { // TODO Auto-generated method stub System.out.println("조병수-20191120-스트림"); String s = new String(); try { FileInputStream fin = new FileInputStream("F://Users/whqud/Desktop/1234.txt"); int c; while((c=fin.read())!=1) { s=s+(char)c; } System.out.println(s); fin.close(); }catch(IOException ioe) { System.out.println("파일없음"); }catch(Exception e) { System.out.println("파일지얼 하세요"); } } }

실행창

lobster