Overriding member variables in Java ( Variable Hiding)

前端 未结 12 1122
小蘑菇
小蘑菇 2020-11-22 03:07

I am studying overriding member functions in JAVA and thought about experimenting with overriding member variables.

So, I defined classes

public clas         


        
12条回答
  •  温柔的废话
    2020-11-22 03:43

    Variables are resolved compile-time, methods run-time. The aRef is of type A, therefore aRef.Intvalue is compile-time resolved to 1.

提交回复
热议问题