Advertisement
erikblomqvist

class: Event

Nov 2nd, 2011
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.76 KB | None | 0 0
  1.  
  2. /**
  3.  * Write a description of class Event here.
  4.  *
  5.  * @author (your name)
  6.  * @version (a version number or a date)
  7.  */
  8. public class Event
  9. {
  10.     // instance variables - replace the example below with your own
  11.     private String mDescription;
  12.     private int mAffectMood;
  13.  
  14.     /**
  15.      * Constructor for objects of class Event
  16.      */
  17.     public Event(String desc, int affectValue)
  18.     {
  19.         mDescription = desc;
  20.         mAffectMood = affectValue;
  21.     }
  22.    
  23.     public String getDescription()
  24.     {
  25.         return mDescription;
  26.     }
  27.  
  28.     public int getAffectMood()
  29.     {
  30.         return mAffectMood;
  31.     }
  32.  
  33.     public String toString()
  34.     {
  35.         return mDescription + " Ditt humör påverkas med värdet: " + mAffectMood;
  36.     }
  37. }
  38.  
  39.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement