Page 114 (PDF page 158):
It says "In Chapter 21, you'll learn how to place implicit method
definitions in a companion object for Rational, so they can be more
easily placed into scope when client programmers are working with
Rationals".
It's true that we can place the implicit method in the companion object
of Rational, however, it does not work as one expects. Please see
explanation in
http://stackoverflow.com/questions/4569192/implicit-conversion-import-requ
ired-or-not
Actually in Chapter 21, it use the same implicit method example as the
one in page 112 for the Rational class. This confuses a beginner a lot
during study.
|