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

What are the main differences between the java platform and other platforms?

0 Answers  


how can you catch multiple exceptions in java?

0 Answers   Cyient,


Why there are some null interface in java? What does it mean?

0 Answers  


Is string serializable in java?

0 Answers  


what is difference between length and length()?

8 Answers  






Why do we need data structure in java?

0 Answers  


what is difference between interface and abstract class..?

4 Answers  


Can private class be extended java?

0 Answers  


How many objects are created for a singleton class

7 Answers   Ness Technologies,


How do you control extraneous variables?

0 Answers  


What is the output of the below java program?

0 Answers  


Can list be final in java?

0 Answers  


Categories