Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Errata for OCP: Oracle Certified Professional Java SE 8 Programmer II Study Guide -page 136 (Sybex)  RSS feed

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think  the add and offer method's descriptions should be same for ArrayDequeue  in the table 3.5 ?

Because both of two methods invoke the addLast(e) method. And also offer method can throw an exception..
 
author & internet detective
Marshal
Posts: 38250
623
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Erdem,
I've added the fact that offer can throw an exception to the errata. Thanks for noticing that.
 
Ranch Hand
Posts: 74
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I disagree with that one, since method offer(e) doesn't throw an exception --> see API Doc: Interface Queue<E>
Summary of Queue methods:
                Throws exception     Returns special value
Insert       add(e)                     offer(e)
Remove    remove()                 poll()
Examine   element()                peek()

Furthermore add(e) invokes addLast(e), while offer(e) invokes offerLast(e).
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 38250
623
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know what I was thinking when I logged the errata. As you noted the JavaDoc clearly says that. Removed the errata.
 
Ranch Hand
Posts: 115
11
Eclipse IDE Hibernate Java Netbeans IDE Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Jeanne Boyarsky wrote:I don't know what I was thinking when I logged the errata. As you noted the JavaDoc clearly says that. Removed the errata.



Hello Jeanne. I was just about to create a topic about this.
I believe the errata wasn't removed yet, right?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 38250
623
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

João Victor Gomes wrote:

Jeanne Boyarsky wrote:I don't know what I was thinking when I logged the errata. As you noted the JavaDoc clearly says that. Removed the errata.



Hello Jeanne. I was just about to create a topic about this.
I believe the errata wasn't removed yet, right?


I apparently had some "press save after making change" troubles. Now it is really removed from the list.
 
Hold that thought. Tiny ad:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!