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 |
When parseint method can be used?
What is charat java?
What is super constructor?
why did you choose your career in IT?
How do you detect memory leaks?
Compare Mutex and Semaphore in java.
Can a class be private or protected in java?
What is the use of hashmap in java?
What is an i/o filter?
What is run-time class and system class? what is their purpose?
What are void pointers?
Can we write any code after throw statement?