Understanding inheritance in java : SuperclassVariable can reference a Subclass Variable

Migrated from logicaletter.com Superclass : A parent class Subclass : A child class that inherits Superclass class A{ //superclass or parent class //some generic code } class B extends A{ //subclass or child class of A //some generic code } it may seem esoteric at first, but its true that superclass variable can reference a subclass object .This aspect is quite useful when superclass object needs parameters same as subclass object which is not part of that superclass object....

October 23, 2018 · voidash