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 null in java?
What is the purpose of an interface?
Why do we need array in java?
Why Do I Get A "permission Denied" Error After Downloading The .jnlp Java Launcher For The Vkvm?
What do you mean by default constructor in java?
what are different ways in which a thread can enter the waiting state? : Java thread
Is java a prime method?
Why pass by reference is not possible in java?
can java object be locked down for exclusive use by a given thread? : Java thread
What is an example of a constant variable?
I have multiple constructors defined in a class. Is it possible to call a constructor from another constructor’s body?
When a thread is executing a synchronized method , then is it possible for the same thread to access other synchronized methods of an object ?
What is the purpose of encapsulation?
Why arraylist is not synchronized in java example?
What’s a deadlock?