• Post Reply Bookmark Topic Watch Topic
  • New Topic

core java  RSS feed

 
harsh garg
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
public static void main(String args[])


why java programmers made entry point of java program so big? and what is the used of these words in Programs?
 
srinivas srinivasmeenavalli
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess you come from 'C' Language background.Each word has meaning.
public - methods canbe accessed out side of the class/package
static - need not to create instance of the class to execute
void - retuns nothing
main -entry point for application . How java would be knowing where to execute like "main method in 'C'"
String args[] - You can pass n arguments to this method.
 
Campbell Ritchie
Marshal
Posts: 56541
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch, Srinivas and thank you for a useful answer.

Harsh Garg (BTW: Is that your real name?) please don't use vague names like "core java" for your threads: please look at this FAQ.
 
Charles Lyons
Author
Ranch Hand
Posts: 836
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess you come from 'C' Language background.
As opposed to C++ where you have the equally long:which is actually less in keeping with what you'd expect (you think it would be static, but it has to be defined as though it's external)
 
harsh garg
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am not satisfied with these answers
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then tell us what more you want to know.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12563
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why does it matter how 'big' the starting point is? Each part has a very specific meaning, and they all make sense, once you understand them. Since it's always the same, you really never even have to type it... a good IDE will build it for you each time.

so, again, what's the problem with it being that big?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!