
/**
  * Burton Rosenberg
  * 17 May 2002
  *
  */

public class StandardInputTest
{

    public static
    void main ( String [] args )
    {
        System.out.print("Integer? ");
        int i = readInteger() ;
        System.out.println("Value read: " + i ) ;
        System.out.print("Double? ");
//        double d = readDouble() ;
//        System.out.println("Value read: " + d ) ;
        System.out.print("String? " ) ;
        String s = readString() ;
        System.out.println("Value read: " + s ) ;
    }

    // magic words to get a buffered reader from system.in
    static java.io.BufferedReader br = new java.io.BufferedReader(
            new java.io.InputStreamReader( System.in ) ) ;

    static int readInteger() {
        try {
            // get a line of text, parse it as an integer
            return Integer.parseInt(br.readLine()) ;
        }
        catch ( java.io.IOException ioe ) {
            throw new RuntimeException("IOException") ;
        }
    }

/*
    static double readDouble() {
       try {
          // get a line of text, parse it as a double
          return Double.parseDouble(br.readLine()) ;
       }
       catch ( java.io.IOException ioe ) {
          throw new RuntimeException("IOException") ;
       }
    }
*/

    static String readString() {
       try {
          // get a line of text
          return br.readLine() ;
       }
       catch ( java.io.IOException ioe ) {
          throw new RuntimeException("IOException") ;
       }
    }

}
