java.time.LocalTime.parse(CharSequence text, DateTimeFormatter formatter)


java.time.LocalTime.parse(CharSequence text, DateTimeFormatter formatter)

package com.codingdict;

import java.time.LocalTime;
import java.time.format.DateTimeFormatter;

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

      DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ISO_LOCAL_TIME;
      String time = "10:15:30";
      LocalTime time1 = LocalTime.parse(time, dateTimeFormatter);
      System.out.println(time1);
   }
}