Ashish
Ashish

Reputation: 45

Reading single character from console in java

How to read single character from console in java...?? can it done without BufferedReader..?

Upvotes: 1

Views: 2557

Answers (1)

Justin Niessner
Justin Niessner

Reputation: 245429

Using:

int byte = system.in.read();
char singleChar = (char)byte;

should read a single byte from the console.

Upvotes: 4

Related Questions