Science, asked by viratno2023, 1 year ago

Why main method is static in java?

Answers

Answered by cutieeee10101
5
HEY MATE......

HERE IS UR ANSWER......❤❤

This is neccesary because main() is called by the JVM before any objects are made. Since it is static it can be directly invoked via the class. Similarly, we use static sometime for user defined methods so that we need not to make objects. void indicates that the main() method being declared does not return a value.

HOPE IT HELPS YOU AND MARK AS BRAINLIEST.......☺☺
Answered by akanksha2614
1

Answer:

That's why main is static. The main() method is static because its convenient for the JDK. ... Hence making it a convention to make the entry method 'main()' as 'public static void main(String[] args)' is convenient.

Similar questions