Solved

get key from console

Posted on 2001-06-13
3
239 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: 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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
xampp tool 12 60
SHA2 certs for IIS AND Java? 2 122
maven module vs maven project 3 74
Java: anonymous class 4 38
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This video teaches viewers about errors in exception handling.

726 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