61.Sun 教程中的计数Application
Java 的"Nuts and Bolts"(技巧)
这个application 从标准输入读, 计数读入的字符数, 然后显示计数结果
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.");
}
}
Copyright: NPACT