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
Write an algorithm for quick sort?
Can we override the private methods?
Is string passed by reference in java?
What is an immutable class? How to create an immutable class?
How do you remove duplicates in java?
What are the procedures?
What is the benefit of lambda expressions?
Is java a prime method?
how many types of Inheritance?
What is meant by interface?
Can constructor return value?
What are the advantages of unicode?
What is advantage of java?
Can we declare array without size in java?
If an object reference is set to null, will the garbage collector immediately free the memory held by that object?