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
What are the advantages and disadvantages of reference counting in garbage collection?
What is a stack class in java ?
Is a case study a method or methodology?
Can a class have a static inner class?
What is java and their uses?
Can a java program have 2 main methods?
What are the differences between heap and stack memory in java?
what are the high-level thread states? : Java thread
Is void a keyword in java?
What is a super method?
Is a class an object?
What is the use of arraylist class in java?
How many bytes is double?
What is function declaration?
How to declare objects of a class ?