GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Tech FAQs  >  Programming  >  Java

 Print  |  
Question:  Print Command Line Arguments

Answer: How to print Command Line Arguments without using IO Classes?


June 06, 2008 04:05:49 #1
 aswinikalapeeti   Member Since: June 2008    Total Comments: 1 

RE: Print Command Line Arguments
 

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

     

 

Back To Question