(1) instance method could be overridden, in runtime, java detected that myA is of B type and invoking myA.doA
(2) class static method could be hidden but not be overiden, before runtime dynamic biding, compiler assigned the A.doA2 to myA.doA2
(3) instance variable could be hidden but not be overiden, before runtime dynamic binding, compiler assigned the A instance.a to my.a
D,E,F
@hammedm,
you’re wrong, E is not printed.
C instead.
cdf
CDF
D,C,F
b1,a2 and 5
http://ru.stackoverflow.com/questions/482974/java-%D0%BE%D0%B1%D1%80%D0%B0%D1%89%D0%B5%D0%BD%D0%B8%D0%B5-%D0%BA-%D0%BF%D0%BE%D0%BB%D1%8E-%D0%BF%D0%BE%D0%B4%D0%BA%D0%BB%D0%B0%D1%81%D1%81%D0%B0-%D0%B5%D1%81%D0%BB%D0%B8-%D0%B5%D0%B3%D0%BE-%D1%8D%D0%BA%D0%B7%D0%B5%D0%BC%D0%BF%D0%BB%D1%8F%D1%80-%D0%BF%D1%80%D0%B8%D1%81%D0%B2%D0%BE%D0%B5%D0%BD-%D1%81%D1%81%D1%8B%D0%BB%D0%BA%D0%B5-%D0%BD%D0%B0-%D1%81%D1%83%D0%BF%D0%B5%D1%80-%D0%BA
http://stackoverflow.com/questions/8799018/inheritance-of-final-fields-in-java
(1) instance method could be overridden, in runtime, java detected that myA is of B type and invoking myA.doA
(2) class static method could be hidden but not be overiden, before runtime dynamic biding, compiler assigned the A.doA2 to myA.doA2
(3) instance variable could be hidden but not be overiden, before runtime dynamic binding, compiler assigned the A instance.a to my.a