Here you can find the source of ReadFile(String file)
public static void ReadFile(String file)
//package com.java2s; //License from project: Open Source License import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; public class Main { public static void ReadFile(String file) { // Membaca isi file try {/*w w w. j a v a2s . c om*/ BufferedReader in = new BufferedReader(new FileReader(file)); String str; // Membaca sampai akhir stream while ((str = in.readLine()) != null) { System.out.println(str); } // Menutup stream dan melepaskan resource in.close(); } catch (IOException ex) { System.err.println(ex.getMessage()); } } }