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

Answer Posted / saikat chowdhury

'public' keyword is an access specifier.It means you can access anywhere of the program using this specifier.When we use in the main function it can be access outside of the(class, package,subclass.'Static' also a keyword.When we use this in the main function that means you do not need to create the object of static.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Difference between notify() method and notifyall() method in java?

545


What are the two categories of data types in the java programming language?

501


How to create a base64 decoder in java8?

554


Why are global variables used?

498


How to access arraylist elements in java?

486






Why convert an applet to an application?

614


os is developed in c no java is more secured then c na why dont the os developed is developed using java

3518


what is the significance of listiterator in java?

615


What is autoboxing and unboxing?

577


What is a jagged array in java?

531


What is an immutable object? How do you create one in java?

597


When we should use serialization?

561


Explain hashset and its features?

572


What is the null?

538


Why java is not 100% object-oriented?

825