Imagine having the classes:
public class classA {
public static String name() {
return "classA";
}
}
public class classB {
public static String name() {
return "classB";
}
}
Since both classes have the same-named static method, I would like to make something like a parent element that they would relate to that would declare that all its child would implement a static method name().
Using interfaces is impossible since I don't want the declaration of the static method to be inside the interface and static methods cannot be overridden. Also, using an abstract class is also not a solution since I can't declare an abstract static method.
Is there a way of doing what I would want to?