Check out example codes for "override abstract method java". It will help you in understanding the concepts better.

Code Example 1

public interface Order
{
    public boolean greaterThan(Order other);
}

public class AirCraft implements Order
{
   private String make;
   private int numSeats;

   public AirCraft(String make, int numSeats)
   {
      this.make = make;
      this.numSeats = numSeats;
   }

   public String getMake()
   {
      return make;
   }

   public int getNumSeats()
   {
      return numSeats;
   }

   @Override
   public boolean greaterThan(Order other)
   {
      AirCraft x = (AirCraft)other;
      return getNumSeats() > x.getNumSeats();
   }
   
   public String toString()
   {
       return make + " -> " + numSeats;
   }
}

Learn ReactJs, React Native from akashmittal.com