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 adapter in java?
Can extern variables be initialized?
why java is not supporting multiple inheritence?
What is a conditional statement explain with example?
Why does abstract class have constructor?
What are keywords and reserved words in java?
What are the Class Libraries ?
What is constructor chaining in java?
What is anonymous class?
What is boolean false?
why java is better then .net?
What is the use of bin and lib in JDK?