Why do we use public static with the main function in Java?
Answer Posted / balaji kumar
public - it can be access outside of the(class, package,
subclass and world).
Static- It is used to run a method without any references of
a class. Then JVM will check all the 'static' methods in
"main class" and run the main method from those.
void- main method always has no return value to outside
methods or others. so it uses void keyword.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is early binding and late binding in java?
Which class is the superclass of all classes?
What is ++ a in java?
What is derived datatype?
Why is it called boolean?
Can java cast null?
Can we declare register variable as global?
Can we create our own wrapper class in java?
What is internal iteration in java se 8?
What restrictions are placed on method overloading?
What are the different types of constructor?
Is java a super set of javascript?
What is string variable?
What are desktop procedures?
Explain about varargs in java?