amit kumararya wrote:also, can you please tell me the complete declaration of how to use system.in.
The fact is that most people rarely use it directly - although there's nothing to stop you doing so - it's usually wrapped in a more user-friendly object like a Scanner (java.util.Scanner).
This page, for example, shows you how to get console input using a BufferedReader, but personally, I'd advise reading the tutorial chapter on
I/O because that will give you a much more comprehensive explanation on how streams work in
Java.
Winston