0 votes
14 views
Why is the main method static?
in Education by (48.2k points)

1 Answer

0 votes

Why is the main method static?

Because the object is not required to call the static method. If we make the main method non-static, JVM will have to create its object first and then call main() method which will lead to the extra memory allocation. More Details.

by (48.2k points)

Related questions

0 votes
1 answer 11 views
0 votes
1 answer 10 views
0 votes
1 answer 12 views
0 votes
1 answer 28 views
0 votes
0 answers 56 views
0 votes
1 answer 13 views
13 views asked Nov 19, 2020 in Education by Editorial Staff (48.2k points)
0 votes
1 answer 13 views
0 votes
1 answer 12 views
0 votes
1 answer 16 views
0 votes
1 answer 66 views
0 votes
1 answer 22 views
0 votes
1 answer 20 views
0 votes
1 answer 22 views
0 votes
1 answer 13 views
0 votes
1 answer 45 views
0 votes
1 answer 12 views
0 votes
1 answer 33 views
0 votes
1 answer 12 views
0 votes
1 answer 12 views
12 views asked Nov 19, 2020 in Education by Editorial Staff (48.2k points)
...