Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial

Pranjal Agnihotri
4,187 PointsHow to take console input in java using System.in.read().
How to use System.in.read(); and what does System means in java?
2 Answers

Max Meijer
3,048 Pointsbecaus on line 2 you used a int, a int statment wil only do number. if you want to use words you need to use a string.

Fahad Mutair
10,359 PointsHi Pranjal Agnihotri , this method will read only one character not a words and it return the character encoding as an integer variable
System.out.println("write any letter or number: ");
int example = System.in.read();
System.out.println("The encoding value of your character is: ");
System.out.println(example);
write any letter or number:
9
The encoding value of your character is:
57