Hi, can someone help me modify this code to achieve the following:
Add methods to your Human that return collections of arms and legs. implement these methods by iterating through the collection of limbs and checking what type of limb they are. Note that you will need to use the instanceOf keyword.
I have class Arms and class Leg. Both two classes implement interface Limb.
Is there a way I can change my getLegs() and public void getArms() methods to achieve the above?
Hi, can someone help me modify this code to achieve the following:
Add methods to your Human that return collections of arms and legs. implement these methods by iterating through the collection of limbs and checking what type of limb they are. Note that you will need to use the instanceOf keyword.
I have class Arms and class Leg. Both two classes implement interface Limb.
Is there a way I can change my getLegs() and public void getArms() methods to achieve the above?
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.