The properties of the same name of the parent and child classes are not directly overwritten, but exist in different domains. The static reference is whose property is the last one to be accessed. To set or get access to the property of the parent class, use super
The rewriting of static methods is binding static references
public class TT {
public static void ss(){
System.out.println("f");
}
public static void main(String[] args) {
TT.ss();
S.ss();
TT s=new S();
s.ss();
}
}
class S extends TT{
public static void ss(){
System.out.println("s");
}
}
As a result,
static methods are only related to static classes, S hides the static methods of the parent class,
and the binding of s should be the TT class when compiled.