// // example of use of methods from Input class. // // observe notation "Input.methodname" to reference static methods. // public class TestInputLoop { // reads and echoes lines from stdin until end-of-file key // is pressed (control D for Unix, control Z for DOS). // echoes "That's all, folks!" at end (if you don't get // this, you've probably used the wrong key as EOF). public static void main(String[] args) { String s ; do { System.out.println("Enter a string") ; try { s = Input.readString() ; System.out.println(s) ; } catch (InputEOFException e) { s = null ; } } while (s != null) ; System.out.println("That's all, folks!") ; } }