java.time.LocalTime.isSupported() 方法示例


java.time.LocalTime.isSupported() 方法示例

package com.codingdict;

import java.time.LocalTime;
import java.time.temporal.ChronoField;

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

      LocalTime time = LocalTime.parse("12:30:30");
      System.out.println(time.isSupported(ChronoField.CLOCK_HOUR_OF_DAY));  
   }
}