import java.io.*;
public class InputFileTest {
  public static void main(String[] args) 
                     throws Exception {
    File testFile = new File("test.txt");
    FileInputStream fIn = new FileInputStream(testFile);
    BufferedReader in = 
            new BufferedReader(
                       new InputStreamReader(fIn));
    System.out.println("Enter a string");
    String s = in.readLine();
    System.out.println("You entered " + s);
  }
}