[java] How to get Month Name from Calendar?

if you have multi-language interface, you can use getDisplayName to display the name of month with control of displaying language.

here is an example of displaying the month name in english, frensh, arabic and arabic in specific country like "Syria":

    Calendar c = Calendar.getInstance();
    System.out.println(c.getDisplayName(Calendar.MONTH, Calendar.LONG, Locale.ENGLISH ) );
    System.out.println(c.getDisplayName(Calendar.MONTH, Calendar.LONG, Locale.FRANCE ) );
    System.out.println(c.getDisplayName(Calendar.MONTH, Calendar.LONG, new Locale("ar") ) );
    System.out.println(c.getDisplayName(Calendar.MONTH, Calendar.LONG, new Locale("ar", "SY") ) );
    System.out.println(c.getTime().toString());

the result is:

  January
  janvier
  ?????
  ????? ??????
  Sat Jan 17 19:31:30 EET 2015