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 |
String is mutable or immutable?
What is a locale?
What is the difference between constructor and method?
How are observer and observable used in java programming?
Can a class be defined inside an interface?
This is related to threads. I have a class with synchronized method m1(). Can I create different instances of this class and execute the m1() for different threads?
What is anagram of a string?
Why is a string immutable?
Why Java doesn’t support multiple inheritance?
Tell me about your ability to work under pressure
Why put method is used?
Explain about the main() method in java?