title: Java: subclass calling parent class methods
body: <p>I have a parent class <strong>Shape</strong> and a subclass <strong>Rectangle</strong>, I have a method in parent class Shape called <strong>Output</strong>.
  How can I call the parent class method <strong>Output</strong> in the children class?</p>
  
  <p><strong>The Parent Class</strong></p>
  
  <pre><code>public class Shape {
    public int edge;
    public Shape(int Gedge) {
      edge=Gedge;
    }
    public void Output() {
      System.out.println("This shape has "+edge+" eges");
    }
  }
  </code></pre>
  
  <p><strong>The Subclass:</strong> </p>
  
  <pre><code>public class Rectangle extends Shape {
    public int edge, length, width;
    public Rectangle(int Gedge, int Glength, int Gwidth) {
      super (Gedge);
      edge=Gedge;
      length=Glength;
      width=Gwidth;
    }
    public void Output1() {
      //I want to call the parent class Method "Output" here.
      System.out.println("The Area is "+length*width);
  }
    public static void main (String [] args) {
      Rectangle A1=new Rectangle(4,3,5);
        A1.Output1();
  }
  }
  </code></pre>
  
  <p>If I run this code now, the output is <strong><em>The Area is 15</em></strong>, but I want to call the Output method in Shape, so ideally it prints</p>
  
  <p><strong><em>This shape has 4 edges</em></strong></p>
  
  <p><strong><em>The area is 15</em></strong></p>
  
  <p>Help is Appreciated. Thanks</p>