Call constructor from parent - Java Object Oriented Design

Java examples for Object Oriented Design:Inheritance

Description

Call constructor from parent

class Ball
{
      private double weight;

      public Ball(double weight)
      {
            this.weight = weight;
      }
}

class BaseBall extends Ball
{
      public BaseBall()
      {
            super(5.125);
      }
}

Related Tutorials