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 is adapter in java?

0 Answers  


Can extern variables be initialized?

0 Answers  


why java is not supporting multiple inheritence?

3 Answers  


What is a conditional statement explain with example?

0 Answers  


Why does abstract class have constructor?

0 Answers  






What are keywords and reserved words in java?

0 Answers  


What are the Class Libraries ?

0 Answers   Wipro,


What is constructor chaining in java?

0 Answers  


What is anonymous class?

2 Answers  


What is boolean false?

0 Answers  


why java is better then .net?

5 Answers   HCL, iGate,


What is the use of bin and lib in JDK?

8 Answers   TCS,


Categories