The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
January 2002



This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


How to read from the keyboard

Posted by Hiran on January 25, 2002 at 10:24 AM

Just as System.out is the way you access the monitor, access the keyboard. When you create the InputStreamReader object, just pass as the input stream. For example:

BufferedReader test = new BufferedReader(new InputStreamReader(;

I hope this answers your question. If you need an explanation of BufferedReader or InputStreamReader, just ask your specific question, and someone will help you out.

> Respected sir,
> I want to know about How to read input for a program from
> keyboard using InputstreamReader and BufferReader in Java.
> Could u please give a breif explanation for me.I can't understand from the book.
> Thank u!
> Awaiting u'r Answer.
> J.Gopalakrishnan


Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us