I have a variable MINDATE in MyConstants file. You can see the declaration below.
public static final LocalDateTime MINDATE = LocalDateTime.of(LocalDate.of(2011, 1, 1), LocalTime.MIDNIGHT);
Run Code Online (Sandbox Code Playgroud)
I am consuming this variable in another class just by using MyConstants.MINDATE
then I get the following exception
Exception in thread "main" java.lang.ExceptionInInitializerError
at com.cw.na.vos.DateTest.main(DateTest.java:14)
Caused by: java.lang.IllegalArgumentException: Unknown pattern letter: T
at java.time.format.DateTimeFormatterBuilder.parsePattern(Unknown Source)
at java.time.format.DateTimeFormatterBuilder.appendPattern(Unknown Source)
at java.time.format.DateTimeFormatter.ofPattern(Unknown Source)
at com.cw.na.vos.MyConstants.<clinit>(MyConstants.java:228)
... 1 more
Run Code Online (Sandbox Code Playgroud)
I am unable to understand the reason behind it.
public …Run Code Online (Sandbox Code Playgroud)