• Post Reply Bookmark Topic Watch Topic
  • New Topic

main method with string array  RSS feed

 
divyesh kumar
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Q. why the main method parameter is defined with the single dimension String Array??
 
William P O'Sullivan
Ranch Hand
Posts: 859
Chrome IBM DB2 Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is for parameters passed on the command line or execution script.

Unless you can type in 2 dimensions, a single dimension array is sufficient.

WP
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
standard answer :- that's the way Java is designed. :-) . designer would have thought in most case String[] is sufficient.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
William P O'Sullivan wrote:
Unless you can type in 2 dimensions

Yup. but it will fail at run time
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!