Advertisement
Guest User

Untitled

a guest
Feb 10th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.72 KB | None | 0 0
  1. public class Card {
  2.    
  3.     private String name; //the person's name
  4.    
  5.     /**
  6.      * default constructor of Card object
  7.      */
  8.     public Card() {
  9.         name = "";
  10.     }
  11.    
  12.     /**
  13.      * modified constructor of Card object
  14.      * @param n the object name
  15.      */
  16.     public Card(String n) {
  17.         name = n;
  18.     }
  19.    
  20.     /**
  21.      * gets the object name
  22.      * @return name the object name
  23.      */
  24.     public String getName() {
  25.         return name;
  26.     }
  27.    
  28.     /**
  29.      * checks to see if object is expired
  30.      * @return Boolean of whether it's expired or not
  31.      */
  32.     public boolean isExpired() {
  33.         return false;
  34.     }
  35.    
  36.     /**
  37.      * returns basic info about the object
  38.      * @return String of card holder and name
  39.      */
  40.     public String format() {
  41.         return "Card holder: " + name;
  42.     }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement