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 - 3 of 3 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,

javac  Demo.java

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.

 

Related Answered Questions

 

Related Open Questions