Why use void in main of java?

Java

1 answer

Answer

1102717

2026-07-28 05:40

+ Follow

Java
Java

No. void is not a data type.

It is mandatory for all Java methods to return something and if it is not going to return anything, we have to mark the method with a "void" return type to let the JVM know that it must not expect anything from the method.

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.