The objective of this program is to create and throw customexceptions.
Please fill in the tasks outlined in the comments (image ofdesired output is attached)
———————————————————————-creditcard.javaskeletoncode———————————————————————-
// Create the following three exception classes, each in its ownclass
// All are checked exceptions (inheriting from Exception)
// ApprovedLimitException
// CardMaxException
// FraudException
public class CreditCard {
private int MAXLIMIT = 5000;
private int credit;
private String location;
// create CreditCard constructor that will throw anApprovedLimitException if
// the credit given is greater than the MAXLIMIT
// create a private subtractCredit method that takes in a purchaseamount and checks if a CardMaxException
// is thrown on the purchase
// make sure to subtract the purchase amount from the
PayPal Gateway not configured
PayPal Gateway not configured