This week's giveaway is in the Beginning Java forum.
We're giving away four copies of Bad Programming Practices 101 (e-book) and have Karl Beecher on-line!
See this thread for details.
Win a copy of Bad Programming Practices 101 (e-book) this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Errata K&B OCP 7 p. 557  RSS feed

 
Ranch Hand
Posts: 56
  • 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: 59392
187
  • 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: 56
  • 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.
 
You ought to ventilate your mind and let the cobwebs out of it. Use this cup to catch the tiny ads:
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!