java.time.Month.getDisplayName() 方法示例


java.time.Month.getDisplayName() 方法示例

package com.codingdict;

import java.time.Month;
import java.time.format.TextStyle;
import java.util.Locale;

public class MonthDemo {
   public static void main(String[] args) {

      Month day = Month.of(3);
      System.out.println(day.getDisplayName(TextStyle.SHORT,Locale.ENGLISH));  
   }
}