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

Answer Posted / ravikiran(aptech mumbai)

public means we are allowing the main method to be accessed
any where in the application.and is declared static because
jvm will look for the static one's once it completes the
loading the class.

Is This Answer Correct ?    11 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Where and how can you use a private constructor?

544


Write a program to reverse a number in java?

568


How does java pattern compile work?

556


Can private class be inherited in java?

564


Is null function in java?

578






what is meant by Garbage collection?

628


What are bind parameters?

563


Does isempty check for null?

575


How can we access some class in another class in java?

557


what is deadlock? : Java thread

534


Explain listiterator and methods in listiterator?

557


What is abstract class? Explain

607


Is nullpointerexception checked or unchecked?

561


What is the use of accept () method in java?

617


What is :: operator in java 8?

568