Program Input using ConsoleReader class

  1. Reading input in Java is quite involved and we do not yet have the knowledge to understand the mechanism fully...

  2. The author of the text book has written the ConsoleReader class that you can use to get input:

  3. Where to get ConsoleReader: click here

  4. How to use ConsoleReader:

       ConsoleReader console = new ConsoleReader(;
       String s;
       int i;
       double d;
       s = console.readLine();
       i = console.readInt();
       d = console.readDouble();

  5. Example program using ConsoleReader: click here

    Example program from book using ConsoleReader: click here