Why do we use public static with the main function in Java?
Answer Posted / saikat chowdhury
'public' keyword is an access specifier.It means you can access anywhere of the program using this specifier.When we use in the main function it can be access outside of the(class, package,subclass.'Static' also a keyword.When we use this in the main function that means you do not need to create the object of static.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Is final static java?
Difference between vector and arraylist.
Does string is thread-safe in java?
Implement two stacks using a single array.
What is the difference between break and continue statements?
What are disadvantages of java?
What is the difference between C++ and Java and your preferences?
How we create object in copy constructor?
What is the use of singleton class?
What is the difference between compile-time polymorphism and runtime polymorphism?
What is tcp and udp?
Explain access modifiers in java.
What is the impact of declaring a method as final?
Explain how to convert any java object into byte array.
Is java still relevant?