The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
January 2002

Advertisement

Advertisement

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.

Message:

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, System.in access the keyboard. When you create the InputStreamReader object, just pass System.in as the input stream. For example:


BufferedReader test = new BufferedReader(new InputStreamReader(System.in));

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.
Hiran

> 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






Replies:

Sponsored Links



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