Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Card {
- private String name; //the person's name
- /**
- * default constructor of Card object
- */
- public Card() {
- name = "";
- }
- /**
- * modified constructor of Card object
- * @param n the object name
- */
- public Card(String n) {
- name = n;
- }
- /**
- * gets the object name
- * @return name the object name
- */
- public String getName() {
- return name;
- }
- /**
- * checks to see if object is expired
- * @return Boolean of whether it's expired or not
- */
- public boolean isExpired() {
- return false;
- }
- /**
- * returns basic info about the object
- * @return String of card holder and name
- */
- public String format() {
- return "Card holder: " + name;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement