Bookmark Topic Watch Topic
  • New Topic

static  RSS feed

 
catherine matthews
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Report post to moderator
in public static void main(String args[])

Why do we use the word static?
Is it possible to use any other?
 
Campbell Ritchie
Marshal
Posts: 55772
163
  • Mark post as helpful
  • send pies
  • Report post to moderator
You call it static because the JVM needs access to it before any objects can be created.
I posted about the same sort of thing only 2 days ago, here.
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please don't post duplicates of the same question. People are less inclined to spend time helping when they find the question has already been answered.
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!