title: Unable to call a method of super class
body: <ul>
  <li>This is a simple demo of inheritance. Here I am unable to call the
  super class method.</li>
  <li>I am trying to implement method overriding here.</li>
  </ul>
  
  <p>.</p>
  
  <pre><code>class supers {
      int x, y;
  
      supers(int a, int b) {
          x = a;
          y = b;
      }
  
      final void volume() {
          System.out.println("area is " + x * y);
      }
  }
  
  class sub extends supers {
      int z;
  
      sub(int a, int b, int c) {
          super(a, b);
          z = c;
      }
  
      void volume() {
          System.out.println("volume is " + x * y * z);
      }
  }
  
  class m{
      public static void main(String args[]) {
          supers obj = new sub(1, 2, 3);
          obj.volume();
      }
  }
  </code></pre>