No, the return type of main() method must be void only. Any other type is not acceptable.
Below diagram demonstrates that the main() method should have void return type:
Since the main() method in Java is not supposed to return any value, it's made void which simply means the main() is not returning.
Interview Questions
Java
Java Tutorial
main() Method
Comments
Post a Comment