Originally posted by Niyas Ahmed Sheikh: What's wrong with this?
Well, first and foremost, it's in the wrong language. If you want to use Java, you should become familiar with the Java API Documentation and the Java Tutorial. They should answer many of your questions about how things are done. That said, in Java 1.5 we can use java.util.Scanner to read a line in from the input stream: