title: abstract with 2 base classes..what is the use of abstract class here in the issue mentioned below
body: <p>I am a java learner..doing exercises from web..</p>
  
  <p>I have an abstract class X and 2 subclasses Y and Z.</p>
  
  <p>Y needs to have an int and should be able to set and get int.
  Z needs to have an arraylist of integers and should be able to get and set it.</p>
  
  <p>My need is to have one object of the baseclass and then make use of either Y or Z alone from the user input. I want to do it  the correct way.</p>
  
  <p>PS: I am not sure how abstract class will help here. but that is part of the requirement..</p>
  
  <p>thanks</p>