|
Java™ by example!
|
|
|
How do I read from standard input?
Standard input (stdin) is represented by System.in. System.in is an instance of the class java.io.InputStream. This means that all its methods work on bytes, not Strings. To read from keyboard, use the Reader classes provided since JDK 1.1 They provide unicode manipulation. Following is an example that reads in 2 Strings from stdin, converts them to integers and displays the multiplication of the two.
Further Information
Author of answer: Joris Van den Bogaert
Comments
Comments to this answer are only viewable by members. Login or become a member!
|
|
|
|
|