Page 1 of 1

About Question enthuware.ocpjp.ii.v11.2.1449 :

Posted: Mon Dec 07, 2020 5:12 pm
by philippe
Another problem with this code:

Code: Select all

LocalDate d = LocalDate.now();
DateFormat df = new DateFormat(DateFormat.LONG);
System.out.println(df.format(d));
Is that the format method of DateFormat takes a Date and not a LocalDate.

Re: About Question enthuware.ocpjp.ii.v11.2.1449 :

Posted: Mon Dec 07, 2020 10:00 pm
by admin
Right. Added to the explanation.
thank you for your feedback!

Re: About Question enthuware.ocpjp.ii.v11.2.1449 :

Posted: Tue Jan 05, 2021 6:41 pm
by philippe
Could it be added in added in question bank 1z0-816 too?

Re: About Question enthuware.ocpjp.ii.v11.2.1449 :

Posted: Tue Jan 05, 2021 9:38 pm
by admin
Done.

Re: About Question enthuware.ocpjp.ii.v11.2.1449 :

Posted: Mon Aug 08, 2022 1:55 pm
by ftejada
DateTimeFormat is not a JDK class, perhaps the question was meant to refer to the java.time.format.DateTimeFormatter class instead? Which indeed does not expose any public constructor.

Re: About Question enthuware.ocpjp.ii.v11.2.1449 :

Posted: Tue Aug 09, 2022 2:03 am
by admin
You are right. It should be DateTimeFormatter.