• 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
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Frits Walraven
Bartenders:
  • Carey Brown
  • salvin francis
  • Claude Moore

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

 
Greenhorn
Posts: 6
  • 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: 6
  • 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: 39234
727
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: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne, thanks a lot for your answer and support!
 
Ranch Hand
Posts: 35
  • 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: 39234
727
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: 35
  • 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!
 
You may have just won ten million dollars! Or, maybe a tiny ad.
Create Edit Print & Convert PDF Using Free API with Java
https://coderanch.com/wiki/703735/Create-Convert-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!