(in java program language )
a. Write an abstract class CommercialFlight with thefollowing features:
Instance Variables: name (String), id (int), a final fieldnumberOfFlights (int).
(numberOfFlights should be above zero, otherwise throw
IllegalArgumentException)
Abstract Methods: a totalCharge() method which returns the totalcharge for the
flight.
Constructor.
Methods: Accessor methods, toString() method which displays thename and id
of the flight and its total charge (returned by the total chargemethod).
b. Write a subclass of CommercialFlight called Express. The classExpress
consists of the following additional instance variables:chargePerFlight (double)
(chargePerFlight should be above zero, otherwise throw
IllegalArgumentException). Implement the totalCharge() method(by
multiplying the chargePerFlight by the numberOfFlights) and themethod
equals.
c. Create a test
PayPal Gateway not configured
PayPal Gateway not configured