Why you need to declare main method as public static void main what happens if the method as private and non static?

1 answer

Answer

1265352

2026-09-07 03:00

+ Follow

That would require a detailed explanation of each of the keyWords involved; if you are just starting to learn Java, suffice it to say that the Java Virtual Machine looks for a method that has that precise signature. As to what happens if you do otherwise, try it out! Probably you will get different error messages, depending on what keyWords you omit or change.

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.