Java OOP Extending Classes and Inheritance
Posted on 2009-04-23
Given an abstract ItemBase class, two subclasses A and B are extended from it with methods specific to each one. For example:
ItemBase has generic method V, W
subclass A has specfic method X
subclass B has specfic method Y
How can the above design be implemented so that ItemBase be used as an Array that contains objects of A or B calling their individual method X or Y? Can methods X and Y be omitted in Itembase or should they be defined in it? How?
Thanks for any help.