This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes regarding the static Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "regarding the static" Watch "regarding the static" New topic

regarding the static

narayana satish

Joined: Dec 21, 2000
Posts: 25
I am a new person to Java. Why we are using static in the main function.Is it necessary,if so why.If not why...
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
Defining a function as static means the function can execute without an instance of the class being created. This is why main is declared as static. It is where execution of a program begins, and it should execute even if no instances of the class are created.


So much trouble in the world -- Bob Marley
I agree. Here's the link:
subject: regarding the static
It's not a secret anymore!