Class CreditCard

  • All Implemented Interfaces:
    java.io.Serializable

    public final class CreditCard
    extends java.lang.Object
    implements java.io.Serializable
    Object representing a user's credit card
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      CreditCard​(java.lang.String cardNumber, int expYear, int expMonth, java.lang.String securityCode)
      Create a credit card with the given details.
    • Constructor Detail

      • CreditCard

        public CreditCard​(java.lang.String cardNumber,
                          int expYear,
                          int expMonth,
                          java.lang.String securityCode)
        Create a credit card with the given details.
        Parameters:
        cardNumber - The card number
        expYear - The expiration year
        expMonth - The expiration month
        securityCode - The security code
    • Method Detail

      • getCardNumber

        public java.lang.String getCardNumber()
      • getExpYear

        public int getExpYear()
      • getExpMonth

        public int getExpMonth()
      • getSecurityCode

        public java.lang.String getSecurityCode()
      • setCardNumber

        public void setCardNumber​(java.lang.String cardNumber)
      • setExpYear

        public void setExpYear​(int expYear)
      • setExpMonth

        public void setExpMonth​(int expMonth)
      • setSecurityCode

        public void setSecurityCode​(java.lang.String securityCode)