This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Zeroth element of the string array passed to the main method contains what ? 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 » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Zeroth element of the string array passed to the main method contains what ?" Watch "Zeroth element of the string array passed to the main method contains what ?" New topic
Author

Zeroth element of the string array passed to the main method contains what ?

Sathi Krishna
Ranch Hand

Joined: Oct 21, 2007
Posts: 51

What does the zeroth element of the string array passed to the public static void main method contain?

A. The name of the program
B. The number of arguments
C. The first argument if one is present

Please Let Me Know the Answer !!

Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1447
    
    6

C. The first argument if one is present


Swastik
Sebastian Janisch
Ranch Hand

Joined: Feb 23, 2009
Posts: 1183
Why don't you just try it out ? ;)

The string array contains the arguments passed to the program separated by space.
So array[0] contains the first argument.


JDBCSupport - An easy to use, light-weight JDBC framework -
sujith Acharya
Ranch Hand

Joined: Dec 25, 2006
Posts: 60
The first argument if its present
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

Sathi, welcome to JavaRanch.

We have a rule here: when you copy a question from a book, mock exam or other source, we require that you quote your sources. So, please tell us where you got this question from.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Zeroth element of the string array passed to the main method contains what ?
 
Similar Threads
Arrays
Array of Objects to be passed into a method
Question about assignment 1b.
array doubt
array problem