Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • 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
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
Bartenders:
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

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

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • 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: 5
  • Mark post as helpful
  • send pies
  • 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: 39172
724
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • 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: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne, thanks a lot for your answer and support!
 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • 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: 39172
724
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • 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: 34
  • Mark post as helpful
  • send pies
  • 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!
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!