In my previous polymorphism tutorials I discussed the principle of polymorphic method invocation. At runtime, the JVM determines which method to invoke based on the type of the object, not the type of the reference variable. Since polymorphism applies to instance methods, does polymorphism apply to instance variables? The answer is no, polymorphism does not apply to instance variables.
Can we override an instance variable just like we can override an instance method? Technically NO, but there is more to it. While it is true that subclasses inherit members of a superclass – and that includes accessible instance variables – simply declaring an instance variable in the subclass with the same type and name merely 'hides' the inherited superclass instance variable.
On this page of the site you can watch the video online Learn Java Programming - Polymorphism and Instance Variables Tutorial with a duration of hours minute second in good quality, which was uploaded by the user Daniel Ross 06 September 2015, share the link with friends and acquaintances, this video has already been watched 929 times on youtube and it was liked by 13 viewers. Enjoy your viewing!