How does java compiler choose correct methods and variables in inheritance
问题 I am a bit confused when inheritance and type casting is mixed. I want to understand the rules which java compiler follows when choosing correct methods and variables in inheritance. I have read something like Variables are bound at compile time and methods are bound at run time. The second one is from stackoverflow (@John Skeet) Overload resolution (which method signature is called) is determined at compile-time, based on the compile-time types of both the method target and the argument