+ 3

Static methods in java

Is it possible to overload and override static methods in java?

4th Jul 2022, 3:57 AM
Himani Perera
Himani Perera - avatar
1 Réponse
+ 7
You can overload a static method in java. You can't override a static method in java . There is no compilation error like overriding a final method, but the method will be hidden from the parent and there is no more polymorphism behavior. https://www.geeksforgeeks.org/can-we-overload-or-override-static-methods-in-java/
4th Jul 2022, 5:28 AM
Roland
Roland - avatar