Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis+ 8
Can we override Static method?
6 Respostas
+ 5
Static methods canĀ notĀ be overridden because they are not part of the object's state. Rather, they belongs to the class (i.e they are classĀ methods). It is ok to overloadĀ staticĀ (and final)methods. No,Static methods can'tĀ be overriden as it is part of a class rather than an object.
more details here.
https://www.google.co.in/amp/s/www.geeksforgeeks.org/can-we-overload-or-override-static-methods-in-java/amp/
+ 9
No, you can hide a static method. š šāāļøš¤
+ 4
We can declare static methods with same signature in subclass, but it is not considered overriding as there wonāt be any run-time polymorphism. Hence the answer is āNoā.
+ 2
A default method cannot override a method from java.lang.Object . The reasoning is very simple, it's because Object is the base class for all the java classes. So even if we have Object class methods defined as default methods in interfaces, it will be useless because Object class method will always be used.
+ 1
no
0
nope