Ex11_1 코드

package org.javaro.lecture; import java.io.*; public class Ex11_1 { public static void main(String[] args) { System.out.println("조병수-20191120-스트림"); String s = new String(); try { FileReader fin = new FileReader("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