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 |
Explain the differences between abstraction and encapsulation?
How is treeset implemented in java?
Can we override the static methods?
Can constructor be inherited?
Why do you canvas?
What is the purpose of a transient variable?
Explain the difference between call by refrence and call by value?
Define jre i.e. Java runtime environment?
what is thread? What are the high-level thread states? : Java thread
What is balanced tree in java?
What is map java?
List types of storage classes in java?