title: Re using super class methods by avoiding overriding of super class methods java in a specific scenario
body: <p>I have two classes 
   ClassA :
       with 4 member variables of different data types and 3 methods(m1(),m2() and m3())</p>
  
  <p>eg :  </p>
  
  <pre><code>class ClassA
         {
             String a;
             String b;
             Double c;
             UserDefinedTypeA d;
           public m1(){
              //All the 4 variables are used here.
             }
           public m2(){
               //All the variables are used here.
             }
           public m3(){
              //All the variables are used here.
             }
  </code></pre>
  
  <p>ClassB : 
       with 4 member  variables and 3 methods(m1(),m2() and m3()). 
  Three of these member variables of same type as ClassA and only the fourth variable type is different.</p>
  
  <p>eg :  </p>
  
  <pre><code>class ClassB
         {
             String a;
             String b;
             Double c;
             UserDefinedTypeB d;
           public m1(){
              //All the 4 variables are used here.
             }
           public m2(){
               //All the variables are used here.
             }
           public m3(){
              //All the variables are used here.
             }
  </code></pre>
  
  <p>Now i would like avoid to overriding of m1,m2 and m3 in sub class because of the type 4th member variable is different. 
  As a solution i am planning to create another member variable in super class with the type : UserDefinedTypeB and initialize this variable from subclass constructor . Have a check inside the all the methods for whether UserDefinedTypeB is null or not . If it is not null the i will execute subclass specific logic otherwise will continue with super class logic which supports UserDefinedTypeB.</p>
  
  <p>But felt this will reduce the performance . Any suggestion on coming up with better approach.</p>