This may be simple to you people but as i am new to java, so i want know actually what is going on in the following part?
if (args.length > 0) {
file =
The args.length value is the number of items in the args array.
If you pass no command-line arguments, you will always get "There are 0 command line arguments".
thats why you checking
if (args.length > 0)
But try running the program like this: java PrintArgs hello my name is mikki2 The words after java PrintArgs are called command line arguments because they are arguments passed to your program from the command line