4 Important Facts about main() in Java.
1. A main() method is an entry point for a java program.
2. main() would be called by the JVM using the class directly without creating an object. That’s why we declare the main method ‘public’ and static.
3. main() would never return any value, so we kept return type void.
4. main() would take parameters in the form of String Array. Which would be used to passing input values at runtime.
Thanks for reading, please like and follow my page to serve you better.
Comments
Post a Comment