• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Sathi Krishna
Ranch Hand
Posts: 51
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1782
14
Android Eclipse IDE Java Java ME
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
C. The first argument if one is present
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
sujith Acharya
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The first argument if its present
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 15862
81
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!