group-icon
Java Developers
Group for Java developers and programmers. Ask questions and get answers related to Java programming
252 Members
Join this group to post and comment.
Vaishanvi Sawant
Vaishanvi Sawant
Information Technology
26 Feb 2019

Why we declared main method as static??

//------------------ 
... 
Public static void main (string []arg)
{

}
//------------------ 
Vishal Jethwani
Vishal Jethwani
Computer Science
2w ago

Bcoz static method can be called without an object

Shweta Thainua
Shweta Thainua
Information Technology
1w ago

Because for that we do not need to create object it is called directly...in case if we doesnt make it static then we have to create object for it that will lead to problem of extra memory allocation....it becomes inefficient