Reading String Input Example
import java.io.* ;
public class CharInput {
public static void main(String[] argv) {
String s;
InputStreamReader ir;
BufferedReader in;
ir = new InputStreamReader(System.in)
in = new BufferedReader(ir); // where does the try go ?
while ((s = in.readLine()) !=null) {
System.out.println(“Echo line:”);
}
}
}
Previous slide
Next slide
Back to first slide
View graphic version