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 |
What is flush () in java?
what is the swingutilities.invokelater(runnable) method for? : Java thread
Is java is a fully object object oriented language?
Can an interface have a constructor?
What does three dots mean in java?
Which sorting algorithm is in place?
what is the replacement for GOTO in java?
Can we override constructors in java?
What is anonymous inner class?
What if constructor is protected in java?
What does replaceall do in java?
What is the difference between Static and final?