OOP Inheritance homework (Animal to lion super class inheritance) : <p>I need to:
Extend the animal class with a Lion class and have different features(done).</p>

<p>Add a field called Liontype class and add a method classifying the lion type per its weight.(Needs to be derived from the superclass)</p>

<p>And print it out.</p>

<p>There are errors in my code and I've been trying to fix it.
Thank for any assistance in advance.</p>

<pre><code>public class Animal {
  private int numTeeth = 0;
  private boolean spots = false;
  private int weight = 0;

  public Animal(int numTeeth, boolean spots, int weight){
    this.setNumTeeth(numTeeth);
    this.setSpots(spots);
    this.setWeight(weight);
  }

  public int getNumTeeth(){
    return numTeeth;
  }

  public void setNumTeeth(int numTeeth) {
    this.numTeeth = numTeeth;
  }

  public boolean getSpots() {
    return spots;
  }

  public void setSpots(boolean spots) {
    this.spots = spots;
  }

  public int getWeight() {
    return weight;
  }

  public void setWeight(int weight) {
    this.weight = weight;
  }
}

//Extend animal class
 public class Lion extends Animal{
  public Lion (int numTeeth, boolean spots, int weight){
  super(numTeeth, spots, weight);
  //Add new attributes
    int age = 0;
    int cubs = 0;
  }

 public static void main(String args[]){
   //Create lions and assign attributes
   Lion lion1 = new Lion();
   lion1.numTeeth = 12;
   lion1.spots = 1;
   lion1. weight = 86;
   lion1.age = 7;
   lion1.cubs = 3;

    //Print attributes
    System.out.println("Lion1 attributes:");
    System.out.println("Number of teeth : " + numTeeth);
    System.out.println("Number of spots : " + spots);
    System.out.println("Weight of lion : " + weight + " kgs");
    System.out.println("Age : " + age);
    System.out.println("No of cubs : " + cubs);
    System.out.println(" ");

   Lion lion2 = new Lion();
   lion2.numTeeth = 16;
   lion2.spots = 0;
   lion2. weight = 123;
   lion2.age = 13;
   lion2.cubs = 5;

    System.out.println("Lion2 attributes:");
    System.out.println("Number of teeth : " + numTeeth);
    System.out.println("Number of spots : " + spots);
    System.out.println("Weight of lion : " + weight + " kgs");
    System.out.println("Age : " + age);
    System.out.println("No of cubs : " + cubs);
    System.out.println(" ");
}

public class Liontype{
  //Trying to get weight from another class
  public Integer getWeight()
  {
    if (weight &gt; 120)
    {
      System.out.println("This lion is a cub");
    }
    else if (weight &gt;= 120 &amp;&amp; weight &lt; 180)
    {
      System.out.println("This lion is a female");
    }
    else if (weight &gt;= 180)
    {
      System.out.println("This lion is a male");
    }
  }
}
}


Expected outcome:

Lion attributes:
Number of teeth : 16
Spots : true
Weight of lion : 83kgs
Age : 13
No of cubs : 3
This lion is a female
</code></pre>
