+ 1
why we declare main () method as static?
why we do not create instances of static method?
7 Respostas
+ 3
This topic is beyond explaination within here however you might want to browse or check oracle, tutorialspoint or stackoverflow.
However in simple terms, the main method is static because this allows us to use it without needing to make an instance in order to access it.
+ 1
static method called without object creation so at the first time running of code main is called so it is declared as static
0
technically main is declared as static because in the beginning of executions the os hand over the control to the JVM and then JVM give the control to class loader and class loader scan the code for static hence we declare main as static .....static is first thing which executed first.....hope u understand... happy coding
0
what is class loader?
0
class loader is a part of Jre .... which dynamically load java classes into jvm
0
why class loader scan code for static only?
0
if I declare any static method then how to call it without creating object?