+ 1

Java method override

It is possible to override the main method in Java?

12th Jul 2025, 7:39 AM
Evgeniy Kazban
Evgeniy Kazban - avatar
2 odpowiedzi
+ 2
Have you looked it up online? What would you like to do? Have you looked here? You could even try it in the code playground. https://www.sololearn.com/discuss/347605/?ref=app https://sololearn.com/compiler-playground/W0uW3Wks8UBk/?ref=app
12th Jul 2025, 8:36 AM
Ausgrindtube
Ausgrindtube - avatar
+ 1
There is the word "override" (not "hide") in the error below: main.java:6: error: a() in main.B cannot override a() in main.A static void a() {} ^ overridden method is static,final 1 error error: compilation failed (exit status 1) https://sololearn.com/compiler-playground/cdQgbBOT2T7h/?ref=app
12th Jul 2025, 11:37 AM
Evgeniy Kazban
Evgeniy Kazban - avatar