Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Did anybody find the same erratum I did?  RSS feed

 
Campbell Ritchie
Sheriff
Posts: 53773
127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
About sorting apples by weight.
 
Mike. J. Thompson
Bartender
Posts: 689
17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:About sorting apples by weight.


Where did you see this?
 
Campbell Ritchie
Sheriff
Posts: 53773
127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the Java8 book.
 
Raoul Gabriel
Author
Greenhorn
Posts: 20
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Campbell,

The Apple class for the sorting example defines a field weight of type Integer [1] so sorting is ok.

However you are right that in the two previous chapters we worked with a field of type int. We will fix this to be consistent across all chapters.

Thanks,
Raoul

[1] https://github.com/java8/Java8InAction/blob/master/src/main/java/lambdasinaction/chap3/Sorting.java
 
Campbell Ritchie
Sheriff
Posts: 53773
127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is all right if you use an Integer, as you say.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!