Why do we need public static void main(String args[])
method in Java...?
Answer Posted / shadow
We need
• public: The method can be accessed outside the
class / package
• static: You need not have an instance of the class
to access the method
• void: Your application need not return a value, as
the JVM launcher would return the value when it exits
• main(): This is the entry point for the application
If the main() was not static, you would require an instance
of the class in order to execute the method.
....!
$HADOW
| Is This Answer Correct ? | 14 Yes | 0 No |
Post New Answer View All Answers
List any five features of java?
What are the differences between path and classpath variables?
What do you mean by platform independence? What is an interface?
Explain the difference between collection api and stream api in java8?
What is the difference between the ">>" and " >>>" operators in java?
Can memory leak happen java?
Explain different types of thread priorities ?
What is int short for?
How many decimal places is a double?
What is the main use of generics in java?
what is method reference in java 8?
List out five keywords related to exception handling ?
What do negative exponents mean?
What is the base class of all exception classes?
Why is whitespace important?