Duplicate :
|
|
Relates :
|
|
Relates :
|
There needs to be a class in java.io that can take ASCII/Unicode input from the keyboard for all the primitive types. Currently the only built-in support is for binary data. That is almost never what is wanted for terminal I/O. The class should be called something like PrintInputStream and it would read character date and assemble it into values of the primitive types. Currently, programmers are obliged to do this by hand, forming the worst possible impression on those new to the language. Even Pascal has better support than this. Even C has better support than this. Even C++ has better support than this. This is how we must currently read an integer from System.in import java.util.*; static DataInputStream dis = new DataInputStream( System.in ); static StringTokenizer st; try { st=new StringTokenizer(dis.readLine()); int myint = Integer.parseInt(st.nextToken()); We have to offer something a bit better! peter.vanderlinden@Eng 1996-09-15
|