• 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

Errata K&B OCP 7 p. 557  RSS feed

 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Two-thirds of the way down page 557 in the third line of class Student, shouldn't new BookDao() be new InMemoryBookDao()?

BookDao dao = new BookDao(); // current
should be:
BookDao dao = new InMemoryBookDao(); // proposed

As per the next page, 558, BookDao is an interface, which can't be instantiated,  and as per the class at the top of 557 the class is InMemoryBookDao.

Just wondering.

m.
 
Marshal
Posts: 64089
215
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you are right; I cannot unfortunately find the errata on the publisher's website so I don't know whether that has been reported before.
 
Mark Kevin
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I can't find the publisher's website errata page either, but it hasn't been listed on coderanch's errata page. Also, it would make much more sense and be clearer if the interface snippet BookDao on p. 558 directly preceded class Student on page 557. It really threw me off.
 
Eliminate 95% of the weeds in your lawn by mowing 3 inches or higher. Then plant tiny ads:
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!