Why do we use public static with the main function in Java?
Answer Posted / bheemrao
if we don't use public in main method jvm is looked for main
method but does not found.so run time error will occurred
"main() method must be declared as public". why its static
means in java we can execute methods with object.if we use
static it will execute without object.
| Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
What is the difference between a constructor and a method?
What is class and its types?
What is the largest long allowed by java?
Who found java?
Where is const variable stored?
How to check if a list is sorted in java?
What is the difference between equals() and?
What happens when a thread cannot acquire a lock on an object in java programming?
What is the use of pattern in java?
How many bytes is string in java?
Why does java doesnt suuport unsigned values?
What is the meaning of variable in research?
What is the original name of java?
What is the difference between applet and application?
What is boolean example?