This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin for Android App Development and have Peter Sommerhoff on-line!
See this thread for details.
Win a copy of Kotlin for Android App Development this week in the Kotlin forum!
  • 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
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Errata for OCPJP Java 8 Jeanne Boyarsky & Scott Selikoff - page 188  RSS feed

 
Ranch Hand
Posts: 31
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.I’ve found the typo error in this book, on page 188.There must be count equals to 2 because of 3 element in the fromArray stream.So it should be 3 instead of 2 on the comment.
Stream fromArray = Stream.of(1, 2, 3); // count 3
 
author & internet detective
Posts: 39129
723
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Confirmed and added to the errata crediting you. Thanks for noticing and pointing it out!
 
Greenhorn
Posts: 13
1
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

In chapter 4, Using Terminal Operations for the min() and max() operations, the method signatures are missing the Comparator interface.


should be
 
Jeanne Boyarsky
author & internet detective
Posts: 39129
723
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mihaela,
Welcome to CodeRanch! Thanks for letting us know about that error. I've added it to the errata list and credited you. Good catch!
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd like to mention the following two points:

page 6:
In the middle of the page it says "It could be added to both, buth then ...". I think this is not true because inner classes cannot have static declarations.

page 17:
last code paragraph, second line:
if ( !(obj instanceof LionEqualsBuilder)) return false;
should be
if ( !(obj instanceof Lion)) return false;
 
Mathias Bader
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
About page 6:
I take it back. It's not inside another class - where I accidentially put it in my thought. Therefore, it is correct.
 
Jeanne Boyarsky
author & internet detective
Posts: 39129
723
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Page 6 - You are correct that it is correct. We have a lot of places where there are multiple classes in the same example. It's easier to make them non-public so we can refer to one set of line numbers. That way we are't saying things like "on line 4 in class Y" in descriptions.

Page 17 - You are correct. I've logged this.
 
Javid Azimli
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There're 2 missing '0' on parameters column, 2 missing 'void', 2 missing 'boolean' on return type column, 2 missing 'accept' and 2 missing 'test' on 'single abstract method' column on table 4.9, on page 211.And as well, the same kind of typo error on page 212 on table 4.10(continued), with columns both return type and single abstract method and on page 212, 213 on table 4.10, with columns both return type and #parameter.But there is another typo error related to table number on page 212.It should be table 4.9(continued) instead of table 4.10(continued).
 
Jeanne Boyarsky
author & internet detective
Posts: 39129
723
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Javid Azimli wrote: There're 2 missing '0' on parameters column, 2 missing 'void', 2 missing 'boolean' on return type column, 2 missing 'accept' and 2 missing 'test' on 'single abstract method' column on table 4.9, on page 211. And as well, the same kind of typo error on page 212 on table 4.10(continued), with columns both return type and single abstract method and on page 212, 213 on table 4.10, with columns both return type and #parameter.


They aren't missing. That's a design/layout decision. The idea is not to repeat information within a cell when it is identical. And the parens aren't there because they are showing the type of the parameter. When there are zero parameters, there aren't types to explain.

Javid Azimli wrote:But there is another typo error related to table number on page 212.It should be table 4.9(continued) instead of table 4.10(continued).


Now that is in fact a layout/rendering error!
 
Javid Azimli
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's an error on page 49 that says "Finally, the method calculateSpeed() is a static member and, like MAX_SPEED, it is available without an instance of interface.".I think this is not true about interface, there couldn't be an instance of interface, because we can't create an instance for interface.Perhaps you know this, but this such an error violates java rules.
 
Jeanne Boyarsky
author & internet detective
Posts: 39129
723
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"an instance of a class that implements the interface". The later is more precise, but implied from the former.
 
author
Posts: 4099
21
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Javid Azimli wrote:I think this is not true about interface, there couldn't be an instance of interface, because we can't create an instance for interface.Perhaps you know this, but this such an error violates java rules.



Yes, we are well aware that you can't instantiate an interface directly without creating an instance of a class that implements an interfaces. It's common, though, to pass objects using interface references (like passing an ArrayList as a List reference). When talking about such objects, it is easier to refer to them as instances of the interface, as this is more concise and has the same meaning as the longer form.

In other words, this is a minor language issue. If you hear someone say an "instance of an interface" they are using shorthand for "an instance of a class that implements the interface." I prefer the short form, but others may feel more comfortable saying the whole thing every time.
 
Javid Azimli
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, It's definitely mistake by saying instance of interface.You could say "reference to an interface".So, you said "Yes, we are well aware that you can't instantiate an interface directly without creating an instance of a class that implements an interfaces.", and from your saying we can guess that we could get an instance of interface via directly creating the class that implements this interface.You can't create an instance of interface neither directly nor indirectly.I don't agree with you about this issue, and I don't believe that vast majority of java professional programmers would say that this's correct one on the book.It's my opinion.I just reported that as an error.If you insist that you're correct, then give me evidence(java related web site link) about this issue.
 
Jeanne Boyarsky
author & internet detective
Posts: 39129
723
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Javid,
Both Scott and I have said that means "you can instantiate a class that implements an interface". Not everything in English is so precise. The question is whether it is clear. Scott and I (and our tech editors) believe it is implied that "instance of interface" implies "a class that implements an interface". You don't. So we have a difference of opinion. You understand how interfaces/classes work which is what's important on that page. Oh, and good luck on the test!
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!