Meaningless Drivel is fun!*
The moose likes Java in General and the fly likes main method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "main method" Watch "main method" New topic
Author

main method

saravanan ragunathan
Ranch Hand

Joined: Aug 02, 2010
Posts: 84

i heard that when i call the main method(java Ex one two)with commandline arguments
jvm will allocate the memory for this arguments and assign the reference to the variable arg..then
what will be the reference when i call main without command line arguments



"I Love Java Ranch"
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18505
    
  40

saravanan ragunathan wrote:then what will be the reference when i call main without command line arguments



An empty array?


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

(And you could answer questions like this by just trying it.)
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: main method
 
Similar Threads
passing arguments from command line
call by value or call by reference
static main method
ID:14 SCJP Question of th day !!!
Reading a String