title: How to decide whether use IS A or HAS A Relation
body: <pre><code>public class B {
  
      public String getMe()
      {
          return "Some";
      }
  }
  </code></pre>
  
  <p>Assume that i have a above class , by which parameters should we decide what to use ?? Whether is a or Has a Relation ??</p>
  
  <p>HAS - A</p>
  
  <pre><code>public class A {
  
  
  
      public static void main(String args[])
      {
          B b = new B();
          System.out.println(b.getMe());
      }
  }
  </code></pre>
  
  <p>or </p>
  
  <pre><code>public class A  extends B
  {
  
  
      public static void main(String args[])
      {
          A b = new A();
          System.out.println(b.getMe());
      }
  }
  </code></pre>