Why do we use public static with the main function in Java?
Answer Posted / deepak divvela
In the main function generally we are using
public static void main(String args[])
that means public is used for call method without being the
member of the class.
and static is used for to call method directly with no need
of the object creation.
| Is This Answer Correct ? | 3 Yes | 7 No |
Post New Answer View All Answers
How arrays are stored in memory in java?
What is a class reference?
What are the main differences between the java platform and other platforms?
What is the difference between replace and replace all?
Is singleton a bad practice?
Is java map thread safe?
What causes memory leaks in java?
How will you calculate the depth of a binary tree if the tree contains 15 nodes?
What is sorting in java?
What are inner classes or non static nested classes in java?
What is an abstract class and what is it’s purpose?
Can we override tostring method in java?
What are the advantages and disadvantages of object cloning?
Explain the reason behind ending a program with a system.exit(0)?
What environment variables are required to be set on a machine in order to run Java programs?