why java main method is given as static method?

Answers were Sorted based on User's Feedback



why java main method is given as static method?..

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

why java main method is given as static method?..

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

Post New Answer

More Core Java Interview Questions

When parseint method can be used?

0 Answers  


What is charat java?

0 Answers  


What is super constructor?

0 Answers  


why did you choose your career in IT?

1 Answers   LIC,


How do you detect memory leaks?

0 Answers  


Compare Mutex and Semaphore in java.

0 Answers   Ciena,


Can a class be private or protected in java?

0 Answers  


What is the use of hashmap in java?

0 Answers  


What is an i/o filter?

5 Answers  


What is run-time class and system class? what is their purpose?

1 Answers  


What are void pointers?

1 Answers  


Can we write any code after throw statement?

0 Answers  


Categories