Solved

get key from console

Posted on 2001-06-13
3
237 Views
Last Modified: 2006-11-17
what is the method to get input from the java console whan a n application running ? similar get input from keyboard in C getchr(), etc...
0
Comment
Question by:adrianmak
3 Comments
 
LVL 9

Expert Comment

by:yongsing
ID: 6185008
You can use System.in.read();
0
 
LVL 9

Accepted Solution

by:
Ovi earned 5 total points
ID: 6185036
System.in.read()
0
 

Expert Comment

by:jatom
ID: 6185929
you can simply use System.in.read(),but if you want more flexibility you can wrap it in BufferedReader,for example
BufferedReader cin;
try{
cin = new BufferedReader(new InputStreamReader(System.in));
}
catch (IOException ioe){
}
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
simple java question 3 59
hibernate insert example 13 34
Is there a simpler dropbox system? 10 34
Tagging and Merging on Branch 1 29
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
The viewer will learn how to implement Singleton Design Pattern in Java.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question