Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817
Moderator: admin
philippe
Posts: 29 Joined: Sun Jul 16, 2017 4:24 pm
Contact:
Post
by philippe » Mon Dec 07, 2020 5:12 pm
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.
admin
Site Admin
Posts: 10055 Joined: Fri Sep 10, 2010 9:26 pm
Contact:
Post
by admin » Mon Dec 07, 2020 10:00 pm
Right. Added to the explanation.
thank you for your feedback!
If you like our products and services, please help us by posting your
review here .
philippe
Posts: 29 Joined: Sun Jul 16, 2017 4:24 pm
Contact:
Post
by philippe » Tue Jan 05, 2021 6:41 pm
Could it be added in added in question bank 1z0-816 too?
admin
Site Admin
Posts: 10055 Joined: Fri Sep 10, 2010 9:26 pm
Contact:
Post
by admin » Tue Jan 05, 2021 9:38 pm
Done.
If you like our products and services, please help us by posting your
review here .
ftejada
Posts: 5 Joined: Mon Jan 28, 2019 2:00 pm
Contact:
Post
by ftejada » Mon Aug 08, 2022 1:55 pm
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.
admin
Site Admin
Posts: 10055 Joined: Fri Sep 10, 2010 9:26 pm
Contact:
Post
by admin » Tue Aug 09, 2022 2:03 am
You are right. It should be DateTimeFormatter.
If you like our products and services, please help us by posting your
review here .
Users browsing this forum: mcpunjabi and 44 guests