Print Command Line Arguments

How to print Command Line Arguments without using IO Classes?

Questions by nv_krishna   answers by nv_krishna

Showing Answers 1 - 1 of 1 Answers

you can print command line arguments, by giving what to print while executing java program.the code for this is

class Demo
                 public static void main(String args[])

                          for(int i=0;i<args.length;i++)
                                  System.out.print("    "  + args[i]);

compiling the above program,


executing the above program,

java Demo hello good morning

output is as follows

hello good morning

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Answer Question

Click here to Login / Register your free account

Send   Reset


Related Answered Questions


Related Open Questions