java.time.Year.query() 方法示例


java.time.Year.query() 方法示例

package com.codingdict;

import java.time.Year;
import java.time.temporal.TemporalQueries;

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

      Year date = Year.parse("2014");
      System.out.printf("Year precision is %s%n",
         date.query(TemporalQueries.precision()));
   }
}