This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Five Lines of Code and have Christian Clausen on-line!
See this thread for details.
Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Sybex Testbank Online Practice Exam 2 (Java OCA 8 Programmer I Study Guide)

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is regarding online practice exam 2 that comes with the book Java OCA 8 Programmer I Study Guide.

In one of the questions it asks:
What is the output of the following code:



The last 2 answer options are:
E. The code does not compile.
F. A runtime exception is thrown.

I answered E, because LocalDate.of(2015, 5) doesn't compile since there is no "of" method with 2 parameters.
The correct answer however is F because there is no time and it uses a DateTimeFormatter.

I thought the "Does not compile" answer always goes before all others. Can someone maybe shed some light on this question?

Thanks in advance!
 
Ranch Hand
Posts: 145
4
Hibernate Spring Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I answered E, because LocalDate.of(2015, 5) doesn't compile since there is no "of" method with 2 parameters.  


Yes . I agree with you , it gives compile time error because there is no two argument of method in LocalDate class.

Hope it helps !
 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Danny de Wit wrote:I thought the "Does not compile" answer always goes before all others. Can someone maybe shed some light on this question?


Did you check the official errata overview of this study guide?
 
Danny de Wit
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Roel De Nijs wrote:

Danny de Wit wrote:I thought the "Does not compile" answer always goes before all others. Can someone maybe shed some light on this question?


Did you check the official errata overview of this study guide?



I didn't but thanks for the link!
 
    Bookmark Topic Watch Topic
  • New Topic