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
Do we have pointers in java?
What is class level lock ?
What do you mean by aggregation?
Convert Binary tree to linked list.
What is keyword auto for?
What does flag mean in java?
What is final keyword?
What are the six ways to use this keyword?
When will you define a method as static in Java?
Can we create constructor in abstract class ?
What is the instance of an object?
Can you pass by reference in java?
Explain importance of inheritance in java?
Can a method be overloaded based on different return type but same argument type?
What is method in research paper?