Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2007

Tip: Looking for answers? Try searching our database.

Java Programming

Thread view: 
hellzlilangel61@gmail.com - 30 Oct 2007 06:35 GMT
main method - public static void main (String [] args)

I want to know how i can add values to the string array arguments and
when I can do this....
Andrew Thompson - 30 Oct 2007 07:19 GMT
>main method - public static void main (String [] args)
>
>I want to know how i can add values to the string array arguments

1)
: from the CLI
java TheClass argument1 argument2 argument3

2)
// from Java code
String[] args = new String{
 "argument1", "argument2", "argument3"
}
TheClass.main(args);
// + other ways..

>..and
>when I can do this....

1) at start-up
2) any time when called from within code.

Note also, that;
1) The word 'I' should always be Upper Case.
2) Asking more specific questions, encourages
more specific answers.
3) A good group for beginners is comp.lang.java.help.

Signature

Andrew Thompson
http://www.athompson.info/andrew/

Roedy Green - 04 Nov 2007 21:52 GMT
>I want to know how i can add values to the string array arguments and
>when I can do this....

normally on the command line.  

you say something like this

java.exe -jar thejar.jar  rose daisy petunia

where the flowers appear as a String[3] array to main.

You can also call main just as you would any other static method.
Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.