• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

understanding the main method

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have learned that we can declare the main method as "public static void main(String... args)"
I am not able to understand this way of making object of String class...
please discuss..
 
Bartender
Posts: 1952
7
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you confused about the varargs notation String...?
Have a look here for details about what this notation implies and what its restrictions are.
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
String[] args and String ... args are same to Java Compiler . the later one is just a syntactic sugar.
 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

shantanu kaushik wrote:I have learned that we can declare the main method as "public static void main(String... args)"
I am not able to understand this way of making object of String class...
please discuss..



What to you want to discuss on?
Varargs in java or String class?
varargs can take any number of parameters. So, you can input the String array as command line arguements.
 
shantanu kaushik
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

What to you want to discuss on?
Varargs in java or String class?
varargs can take any number of parameters. So, you can input the String array as command line arguements.



I want to know about the java varargs as i until now did not know about it..
 
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

shantanu kaushik wrote:I want to know about the java varargs as i until now did not know about it..


In that case, try the link Jelle posted. There's also some information in the Java tutorials - see the section "Arbitrary Number of Arguments".
 
reply
    Bookmark Topic Watch Topic
  • New Topic