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


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

package com.codingdict;

import java.time.LocalTime;

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

      LocalTime time = LocalTime.parse("12:30:30");
      System.out.println(time);  
      LocalTime time1 = LocalTime.parse("12:35:30");
      System.out.println(time1);  
      System.out.println(time1.compareTo(time));  
   }
}