home *** CD-ROM | disk | FTP | other *** search
/ Java Developer's Companion / Java Developer's Companion.iso / documentation / tutorial / java / io / example / Count.java < prev    next >
Encoding:
Java Source  |  1997-07-13  |  252 b   |  12 lines

  1. class Count {
  2.     public static void main(String[] args)
  3.         throws java.io.IOException
  4.     {
  5.         int count = 0;
  6.  
  7.         while (System.in.read() != -1)
  8.             count++;
  9.         System.out.println("Input has " + count + " chars.");
  10.     }
  11. }
  12.