The Nuts and Bolts of the Java Language |
Here, to remind you, is the character-counting program in its entirety:The parts shown in bold are features of the Java language or the Java environment that have not yet been explained in this lesson. See the following pages for a brief introduction to the concepts highlighted in the code sample. Each page will direct you to the appropriate lesson within the tutorial that discusses each topic in more detail.class Count { public static void main(String[] args) throws java.io.IOException { int count = 0; while (System.in.read() != -1) count++; System.out.println("Input has " + count + " chars."); } }
The Nuts and Bolts of the Java Language |