Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (9.5k points)

Can I override this method "public static void main"?

1 Answer

0 votes
by (19.7k points)

You cannot override the main method, because it's static. But you can create a subclass to define another static main method to hide it.

Interested in Java? Check out this Java Certification by Intellipaat.

Related questions

0 votes
1 answer
asked May 4, 2021 in Java by sheela_singh (9.5k points)
0 votes
1 answer
asked Jan 23, 2020 in Java by angadmishra (6.5k points)
0 votes
1 answer
0 votes
1 answer

Browse Categories

...