Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exam, Random question related to java.time package (Java OCA 8 Programmer I Study Guide)

 
Saad Benbouzid
Greenhorn
Posts: 21
Chrome IntelliJ IDE Oracle
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why is answer D a correct answer ?



This code can't compile with solely the mentioned import : "import java.time.LocalDate;", because the import for the <Month> class is missing, as you can see :


So in my opinion as it is answer D is not correct, or answer D should be "java.time.LocalDate; import java.time.Month" instead of just "java.time.LocalDate".
 
Roel De Nijs
Sheriff
Posts: 10662
144
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Saad Benbouzid wrote:So in my opinion as it is answer D is not correct, or answer D should be "java.time.LocalDate; import java.time.Month" instead of just "java.time.LocalDate".

You are absolutely correct! That's a mistake and should be fixed. Many possible solutions: replace Month.JUNE with 6, mark only answer option C as the correct answer, update the answer options adding the import for java.time.Month as well,...

Hope it helps!
Kind regards,
Roel
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Agreed. It should have said 6 instead of Month.JUNE.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic