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 instanceof operator used in java?
What is static variable with example?
What are adapter classes?
What is string pool in java?
Explain access modifiers in java.
Which object oriented concept is achieved by using overloading and overriding?
What does jre stand for?
Explain the difference between abstract class and interface in java?
I want to store more than 10 objects in a remote server? Which methodology will follow?
What is ph and buffers?
What are the files generated after using IDL to java compiler?
How many types of design patterns are there?
What is your platform?s default character encoding and how to know this?
does java support pointers?
What is string substring?