why java main method is given as static method?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is empty in java?

576


What is the static field modifier?

591


What is the meaning of find and replace?

520


What is the maximum size of array in java?

510


Why Java doesn’t support multiple inheritance?

627






How can you add and remove nodes in jtree?

608


What is locale?

594


Can we have more than one package statement in source file ?

580


Is ++ operator thread-safe in java?

624


Can a class extend more than one class?

603


Is sizeof a keyword in java programming?

599


why not override thread to make a runnable? : Java thread

550


How do you detect memory leaks?

576


What is the use of callablestatement?

567


Can constructor be synchronized?

529