You must use a Reader instead of Writer.
There are various ways to read a text file in Java e.g. you can use FileReader, BufferedReader or Scanner to read a text file. Each class has its own purpose e.g. BufferedReader is used to buffer data for reading fast, and Scanner provides parsing ability.
Example using BufferedReader :
public class ReadFile {
public static void main(String[] args)throws Exception
{
File file = new File("C:\\location\\test.txt");
BufferedReader br = new BufferedReader(new FileReader(file));
String st;
while ((st = br.readLine()) != null)
System.out.println(st);
}
}