Not sure I understand the question. If you declare a variable, any
static members are bound at compile‑time and calling them is done on the Foo type. If you create it as a Bar,
static members are still bound at compile‑time. Instance members are dynamically bound (dynamic ≠ static, which might be why they chose the keyword
static) at run‑time, so you get
polymorphism. Because of the potential for confusion, you ought always to use the class name:
Foo.myStaticMethod(...); and you can do that whether or not there are any variables of type Foo.