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 lambda means?
Name the method that used to clear the buffer ?
What is singleton class example?
What is the difference between class forname and new?
Explain the difference between comparator and comparable in java?
How do we make a class serialize?
why marker interfaces are there in java
How does abstract modifier work?
How do you convert bytes to character in java?
What does the “static” keyword mean?
Can we create an object of private class?
what are the boundaries of jdk and jre?