@deHaar to be pedantic, OP never defined a
DateTimeFormatter
. They're just printing that format for the user to read and trying to assign the result of nextLine
(or rather, a non-existing variable called nextLine
) to a LocalDate
.