0
Can we overide static methods?...
Java
3 Réponses
+ 6
No, static methods can't be overridden, but they can be hidden.
+ 2
Here is an article about it: https://www.google.de/amp/s/www.geeksforgeeks.org/can-we-overload-or-override-static-methods-in-java/amp/
0
you can override static method with static method if you call it static way
public class A {
static String method() { return "A"; }
}
public class B extends A {
static String method() { return "B"; }
public static void main(String[] args) {
System.out.println( B.method() ); // B
}
}