write in java define a class named payment that contains a member variable of type d 5155512
Write in Java
Define a class named Payment
that contains a member variable of type double that stores the amount of the payment and appropriate accessor and mutator methods.
Also create a method named paymentDetails that outputs an English sentence to describe the amount of the payment.
Also define equals() method.
Define a class named CashPayment that is derived from Payment.
This class should redefine the paymentDetails method to indicate that the payment is in cash. Include appropriate constructor(s).
Also define equals() method.
Define a class named CreditCardPayment that is derived from Payment.
This class should contain member variables for the name on the card, expiration date(String type,month/day/year, eg. 11/28/2009), and credit card number. Include appropriate constructor(s).
Finally, redefine the paymentDetails method to include all credit card information in the printout.
Also define equals() method.
Create a main method that creates at least two CashPayment and two CreditCardPayment objects with different values and calls paymentDetails for each.
Payment private double amount public Payment() public Payment(double amount) public void setPayment( double amount) public double getPavment() public void pavmentDetails() public boolean equals(Object otherObiect) CreditCardPayment private String name private String expiration; private String creditcard; CashPayment public CashPavment() public CashPavment(double amt) public void pavmentDetails() public boolean equals(Object otherObiect) public CreditCardPavment() public CreditCardPavment(double amt, String name, String expiration, String creditcard) public void pavmentDetails() public String getName() public void setName(String s1) public String getCreditcard() public void setCreditcard(String s3) public String getExpiration() public void setExpiration(String s2) public boolean equals(Object otherObiect)