/* * Basic Algorithms, Fall'98 (Yap) * More Java I/O * * For more info on BufferedReader: * http://www.javasoft.com/products/jdk/1.1/docs/api/java.io.BufferedReader.html */ import java.io.*; public class IOmore { public static void main(String[] args) throws java.io.IOException { // Input Stream: BufferedReader in = new BufferedReader( new InputStreamReader(System.in)); String response; // Character Input: System.out.print("Type a Char:"); System.out.flush(); int n = in.read(); System.out.print("You typed the character value \"" + n + "\"\n"); System.out.flush(); // Character Input: System.out.print("Type a Line:"); System.out.flush(); response = in.readLine(); System.out.print("You typed \"" + response.toString() + "\"\n"); System.out.flush(); } }