• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Java OCP 8 Programmer II Study Guide Error in Chapter 2 Question 12

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi! I've found an error in Java OCP 8 Programmer II Study Guide Chapter 2 Question 12, and I couldn't find any info about this error on the forum or errata list. I'm sorry in advance, if I didn't search well.

There are two public types in question code:



But the given correct answer (C. Compiler error on line x1.) would be really correct only if some of the types weren't public. I chose the answer D. Compiler error on a different line.

Best regards and thanks a lot again for the great book.
 
Dmitry Gorshenin
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Excuse me please. Maybe I slept badly this night (( This seems to be is the common agreement through the questions, but I saw this only when solving q.12 ((
 
author & internet detective
Posts: 42055
926
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dmitry,
Notice there are no line numbers in that example in the book. This means you are free to imagine them in different files.
 
Dmitry Gorshenin
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jeanne, thanks a lot for your answer and support!
 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I don't see line x2 has any problem but line x1 should returns boolean. Can somebody explain the reason of choosing x2. Thank you!
 
Jeanne Boyarsky
author & internet detective
Posts: 42055
926
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Micheal Bush wrote:Hi, I don't see line x2 has any problem but line x1 should returns boolean. Can somebody explain the reason of choosing x2. Thank you!


Check the end of chapter explanation. x2 isn't the answer which is why you can't find anything wrong with it!
 
Micheal Bush
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jeanne Boyarsky wrote:

Micheal Bush wrote:Hi, I don't see line x2 has any problem but line x1 should returns boolean. Can somebody explain the reason of choosing x2. Thank you!


Check the end of chapter explanation. x2 isn't the answer which is why you can't find anything wrong with it!




My bad, Thank you, Jeanne!
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic