Advertisement
DulcetAirman

Java Months

Apr 15th, 2016
129
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package ch.fhnw.claudemartin;
  2.  
  3. import java.time.Month;
  4. import java.time.format.TextStyle;
  5. import java.util.EnumSet;
  6. import java.util.Locale;
  7.  
  8. public class SomeClass {
  9.  
  10.   public static void main(final String[] args) {
  11.     final EnumSet<Month> months = EnumSet.allOf(Month.class);
  12.  
  13.     final Locale locale = Locale.FRENCH;
  14.     for (final Month month : months) {
  15.       System.out.println(month.getDisplayName(TextStyle.FULL, locale));
  16.     }
  17.   }
  18. }
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement