Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis+ 3
Can we override private or static method in java?
Method Overriding in which have method got same name & same parameters...
2 Respostas
+ 14
Static methodsĀ also cannot beĀ overridden, becauseĀ static methodsĀ are a part of the Class itself, and not a part of any instance(object) of that class.Ā YouĀ howeverĀ canĀ declare samestatic methodĀ with same signature in child classes, but that would not be considered as runtime polymorphism (overrideĀ ofmethods) .
https://www.geeksforgeeks.org/can-we-overload-or-override-static-methods-in-java/
https://www.geeksforgeeks.org/can-override-private-methods-java/
https://www.sololearn.com/learn/Java/2165/?ref=app
+ 2
private methods arent visible to subclasses so no.
overriding statics makes no sense because you need to specify the class by calling them which destroys the purpose.