Last active
April 9, 2024 11:37
-
-
Save mcsee/f2f64b2f510c08a4f85a6c8cbe85de58 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Date; | |
public class CreditCard { | |
private String cardNumber; | |
private Date expiryDate; | |
public CreditCard(String cardNumber, Date expiryDate) { | |
// Not a complete date | |
this.cardNumber = cardNumber; | |
this.expiryDate = expiryDate; | |
} | |
public boolean isExpired() { | |
Date currentDate = new Date(); | |
return expiryDate.before(currentDate); | |
// How will it work? | |
// using the last day of the month? | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment