Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 254
  • Last Modified:

get key from console

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
adrianmak
Asked:
adrianmak
1 Solution
 
yongsingCommented:
You can use System.in.read();
0
 
OviCommented:
System.in.read()
0
 
jatomCommented:
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now