Why do we use public static with the main function in Java?
Answer Posted / rameshreddy.k
As we know public means we can access the method from
anywhere. in a java we want call method by using class
object. But main() is also method .that main() is there one
class but jVM execute program trough main() method with out
creating object main() method call thats way we use public
static the main function
thanks& regargs
RAMESH
| Is This Answer Correct ? | 4 Yes | 4 No |
Post New Answer View All Answers
What is the purpose of default constructor?
Is empty .java file name a valid source file name?
What is heterogeneous in java?
Can arraylist hold different types java?
What does singleton mean in java?
Can a main method be declared final?
What is data type example?
What are serialization and deserialization?
What is a generic data type?
I want to store more than 10 objects in a remote server? Which methodology will follow?
What java is used for?
I want to re-reach and use an object once it has been garbage collected. How it's possible?
Why java applets are more useful for intranets as compared to internet?
What is used of static keyword in java?
What is the this keyword?