import java.io.*public class ReadFile { public static void main (String [] args) { try { File (1)___ = new File ("MyText . txt"); (2)___ (3)____ = new (4)____ (x1); (5)____ x4 = new (6)____ (x2); String x3 = null; while (( x3 = (7)___. (8)___ ()) ! = null ) { System.out.println(x3); } (9)___. (10)___(); } catch (Exception ex) { ex.printStackTrace(); } }}
BufferedReaderStreamReaderFileReaderreadLinereadInreadcloseFileclosex1x2x3x4
1. x1 ,2. FileReader , 3. x2 , 4. FileReader , 5. BufferedReader , 6. BufferedReader, 7. x4, 8. readLine , 9. x4 , 10. close
1. x1 , 2. close , 3. x2 , 4. FileReader , 5. x4 , 6. BufferedReader, 7. x4, 8. BufferedReader , 9. x4 , 10. FileReader
1. x1 , 2. FileReader , 3. x2 , 4. FileReader , 5. BufferedReader , 6. BufferedReader, 7. x4, 8. FileReader , 9. x4 , 10.readLine
import java.io.*;public class ReadFile{ public static void main(String s[ ]){ try { File x1=new File("MyText.txt"); FileReader x2=new FileReader(x1); BufferedReader x4=new BufferedReader(x2); String s3=null; while((x3 = x4.readLine( )) != null ) { System.out.println(x3); }x4.close( ); }catch(Exception e){ e.printStackTrace(); } }}