This appears to be a serious question about Java and not meaningless drivel at all. So I'm going to move it to the Java beginners forum. I'm sure that if Anumeha meant it to be a joke, he or she will let us know and it can be moved back.
Anumeha Taori
Greenhorn
Joined: Oct 25, 2009
Posts: 3
posted
0
Oh...my mistake !!!
I am new to this forum. I didn't knew to which forum should I post and I posted it randomly. I didn't meant to joke. Sorry !!
If you are using a Java version less than 5 years old, you will have the Scanner class available. This allows easier access to inputs, including System.in. It is much easier to use than System.in.read(). It has various nextXXX() methods, which allow you to read a particular type of input, but not a nextChar() method. You can try next().charAt(0). But most of the time, you don't really want an individual char, you want a "word".
There is a potential confusion with Scanner, that it can return empty Strings; I commented on that problem here a few weeks ago.
If you want a String, the next() and nextLine() methods of the Scanner class are probably what you want.