daily pastebin goal
22%
SHARE
TWEET

APCS2012_C4X17_Month.java

calcpage Oct 19th, 2012 37 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Month.java    MrG     2012.1019
  2. public class Month
  3. {
  4.         private int month;
  5.         private final int MON_LEN = 3;
  6.         private final String MONTHS="JanFebMarAprMayJunJulAugSepOctNovDec";
  7.  
  8.         public Month(int month)
  9.         {
  10.                 this.month = month;
  11.         }
  12.  
  13.         public String getName()
  14.         {
  15.                 int temp = month*MON_LEN-3;
  16.                 return MONTHS.substring(temp,temp+MON_LEN);
  17.         }
  18. }
RAW Paste Data
Top