java.time.Year.parse() 方法示例 java.time.Year.of() 方法示例 java.time.Year.parse(CharSequence text, DateTimeFormatter formatter) java.time.Year.parse() 方法示例 package com.codingdict; import java.time.Year; public class YearDemo { public static void main(String[] args) { Year date = Year.parse("2017"); System.out.println(date); } } java.time.Year.of() 方法示例 java.time.Year.parse(CharSequence text, DateTimeFormatter formatter)