Java Month Get getMonth(int i)

Here you can find the source of getMonth(int i)

Description

Returns the name of the month, given an int (January==0)

License

Apache License

Declaration

public static String getMonth(int i) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    /**/*from  w  w  w  . j  av  a2  s .c  om*/
     * Returns the name of the month, given an int (January==0)
     */
    public static String getMonth(int i) {
        switch (i) {
        case 0:
            return "January";
        case 1:
            return "February";
        case 2:
            return "March";
        case 3:
            return "April";
        case 4:
            return "May";
        case 5:
            return "June";
        case 6:
            return "July";
        case 7:
            return "August";
        case 8:
            return "September";
        case 9:
            return "October";
        case 10:
            return "November";
        case 11:
            return "December";
        }
        return "Error";
    }
}

Related

  1. getMonth(Date date)
  2. getMonth(Date date)
  3. getMonth(Date date, TimeZone timeZone)
  4. getMonth(Date dt)
  5. getMonth(Date theDate)
  6. getMonth(int i)
  7. getMonth(int month)
  8. getMonth(int month)
  9. getMonth(Integer month)