Why is the main method static in Java?
Answer / nashiinformaticssolutions
Java's main() function is static by default, allowing the compiler to call it either before or after creating a class object. The main () function is where the compiler begins programme execution in every Java programme. Thus, the main () method needs to be called by the compiler. If the main () method is permitted to be non-static, the JVM must instantiate its class when calling the function.
| Is This Answer Correct ? | 0 Yes | 0 No |
Java is Pass by Value or Pass by Reference?
What is Servlet?
Why should we create an object? what is a need of it? Apart from access members of a class i want what is a need of object what does it contain?? In normal class to access any member of thaht class we create object where as for static class we access its members using class name. what is a difference between them... thanks in advance.
Explain about static nested classes in java?
How does enum work in java?
Can you inherit a constructor java?
Why inputstreamreader is used in java?
Explain the use of javap tool.
How to declare unique ArrayList ?
What is the difference in between cpp and java? Can u explain in detail?
Explain the relationship between the Canvas and Graphics class?
What is the difference between array and array list in java?