File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
The Mikado Method
this week in the
Agile and other Processes
forum!
JavaRanch
»
Java Forums
»
Java
»
Beginning Java
Author
Input from Keyboard - urgent please
Rashid Ali
Ranch Hand
Joined: Jan 16, 2001
Posts: 349
posted
Feb 16, 2001 22:28:00
0
Dear participants
Could anybody suggest me how to take input from keyboard for just printing on screen in a very simple way.
Thanks
Rashid
Cindy Glass
"The Hood"
Sheriff
Joined: Sep 29, 2000
Posts: 8521
posted
Feb 17, 2001 09:07:00
0
You need to use System.in to get the console input. However you need to run it through a
BufferedReader
if you want to take in more than 1 char.
BufferedReader consoleIn = new BufferedReader(new InputStreamReader(System.in)); String stringInt = consoleIn.readLine();
[This message has been edited by Cindy Glass (edited February 17, 2001).]
"JavaRanch, where the deer and the Certified play" - David O'Meara
Randall Twede
Ranch Hand
Joined: Oct 21, 2000
Posts: 4089
posted
Feb 17, 2001 13:51:00
0
Printing to the screen is even easier.
continueing Cindy's example:
System.out.println(stringInt);
SCJP
Rashid Ali
Ranch Hand
Joined: Jan 16, 2001
Posts: 349
posted
Feb 19, 2001 02:54:00
0
thanks for both of your messages.
I agree. Here's the link:
http://ej-technologies/jprofiler
- if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
subject: Input from Keyboard - urgent please
Similar Threads
Query
input stuff
keyboard input and graphic window
Query
Assignment 1.1 - Input from Keyboard
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter