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


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

package com.codingdict;

import java.time.MonthDay;
import java.time.format.DateTimeFormatter;

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

      DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("--MM-dd");
      String date = "--10-15";
      MonthDay date1 = MonthDay.parse(date, dateTimeFormatter);
      System.out.println(date1);
   }
}