Hi Sunil

Command line:

    >java foo.Bar a "b c" d e


Java code:

   package foo;
   public class Bar {
       public static void main( String[] args ){
           for (int i = 0; i < args.length; i++)
               System.out.println( ">>" + i + ">>" + args[i]);
       }
   }


Output:

    >>0>>a
    >>1>>b c
    >>2>>d
    >>3>>e


Hope it helps
Mihai

sunil sharma a écrit :
Hi Group

May i know how to pass command line parameter in java.

Regards
sunil
--
To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/javaprogrammingwithpassion?hl=en

--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaprogrammingwithpassion?hl=en

Reply via email to