why java main method is given as static method?
Answers were Sorted based on User's Feedback
Answer / saravanan.v
Java is a object oriented language.So even main method also should be written inside a class name main class.So main method should be called WITHOUT CREATING OBJECT for main class.For this purpose, it is declared as static.
| Is This Answer Correct ? | 6 Yes | 0 No |
Answer / chaithanya
main method is called by JVM.without creating the object we are calling main.that's what it is declared Static.
static nothing but without creating the object,we can call that method
| Is This Answer Correct ? | 2 Yes | 0 No |
Is it possible to define a method in java class but provide it’s implementation in the code of another language like c?
What about main() method in java ?
Can we write any code after throw statement?
What is immutability in java?
Explain about core java?
What is hash method?
What is singletonlist in java?
What is regex java?
what is object slice?
How does map works in java?
whats is inheritance?
15 Answers CTS, HCL,
How to implement an arraylist in java?