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...
adrianmakAsked:
Who is Participating?
 
OviConnect With a Mentor Commented:
System.in.read()
0
 
yongsingCommented:
You can use 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.