You need to look through the information about Java available. I would suggest you start with this part of the Java™ Tutorials. You might need a look at the API for BufferedReader and its related classes.
You will find out the read() method does not do what you think it does. It is not at all suitable for reading text, but takes one character at a time. You may need to push enter before you see any results.