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 stack example?
Why we use protected in java?
What is getclass () getname () in java?
23. Storage space in java is of the form Stack Queue Heap List 24. What is java code embedded in a web page known as Applets Servlets scriptlets snippets 25. Which of the following attributes are compulsory with an
What is class array in java?
What is the use of using enum to declare a constant?
How do you convert string to int in java?
What are the differences between getting and load method?
What is the loop in java?
what is method reference in java 8?
Describe the syntax of multiple inheritance? When do we use such an inheritance?
Explain importance of throws keyword in java?
Which class contains a method: cloneable or object?
What is the most important feature of java? What is an interface?
What type of value does sizeof return?