Why do we use public static with the main function in Java?
Answer Posted / ankit
public is written so that it can be called from outside and
static is written because main is called before the creation
of any object and for static methods object is not required.
| Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
What is style and indentation?
Why spring singleton is not thread safe?
Can a java program have 2 main methods?
What is mutable object and immutable object?
What is memory leak and how does java handle it?
What is bitwise complement?
What is the difference amongst jvm spec, jvm implementation, jvm runtime ?
What is the static variable?
Garbage collection in java?
What is the access scope of protected access specifier?
Write a code to create a trigger to call a stored procedure
What is a key in java?
Difference between default and protected access specifiers?
How will you print number in reverse (descending) order in BST.
What is keyword auto for?