daily pastebin goal
63%
SHARE
TWEET

Person

a guest May 16th, 2018 112 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.ArrayList;
  2.  
  3. public class Person
  4. {
  5.     private String name;
  6.     private ArrayList<Integer> preferences;
  7.     int choice;
  8.  
  9.     public Person(String newName, ArrayList<Integer> newPreferences)
  10.     {
  11.         name = newName;
  12.         preferences = newPreferences;
  13.         choice = 0;
  14.     }
  15.  
  16.     public String getName()
  17.     {
  18.         return name;
  19.     }
  20.  
  21.     public ArrayList<Integer> getPreferences()
  22.     {
  23.         return preferences;
  24.     }
  25.  
  26.     public String toString()
  27.     {
  28.         String result = "";
  29.         for(int p: preferences)
  30.         {
  31.             result = result + " " + p;
  32.         }
  33.         return result;
  34.     }
  35. }
RAW Paste Data
Top