Why do we use public static with the main function in Java?

Answer Posted / deepak divvela

In the main function generally we are using
public static void main(String args[])
that means public is used for call method without being the
member of the class.
and static is used for to call method directly with no need
of the object creation.

Is This Answer Correct ?    3 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What methods are used to get and set the text label displayed by a button object?

561


Does apple use java?

501


Explain the JDB in depth & command line.

577


Can I declare a class as private?

600


Why is a string immutable?

550






What is an inner class in java?

531


What is java and why do we need it? Explain

587


What are the data types supported by java? What is autoboxing and unboxing?

554


What is a concrete classes? Is Java object class is concrete class?

522


What is a nullable field?

583


What is off heap memory?

554


Does sprintf allocate memory?

599


Can subclass overriding method declare an exception if parent class method doesn't throw an exception?

512


Explain working of call by reference function invoking.

594


write a program that list all permutations of ABCDEF in which A appears before B?

2015