Solved

get key from console

Posted on 2001-06-13
3
231 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
topping2 challenge 13 63
Running Jira on Raspberry PI 2? 3 139
backtracking recursion  code 19 41
Java Jpanels and Jframe 8 21
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

743 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now