Could you please tell us the title, author, and publisher of this
terrible book so we can (a) avoid it, (b) recommend against it, and (c)
complain to the publisher?
I find it even stranger that the technical reviewers of the book didn't
pick all this nonsense up. Are you sure you're quoting it accurately?
Well book is called Core Java 2, Volume 1, but as I don't actually
study from this book, it may very well be that author pointed out
( few pages earlier ) the fact that he is simplifying things. I don't
want a guy to loose a million cause of little me.
Anyways, I'm gonna quote the first two steps from the book, since
they appear to cause the most controversy:
"It is important to understand what happens when a method call is
applied to an object. Here are the details:
1) the compiler looks at the declared type of an object and the method
name. Let's say we call x.f(param), and the implicit parameter x is
declared to be an object of class C. Note that there may be multiple
methods, all with the same name, f, but with different parameter
types. For example, there may be a method f(int) and a method
f(String). The compiler enumerates all methods called f in the class C
and all methods called f in the superclasses of C
Now the compiler knows all possible candidates for the method to be
called
2) Next, the compiler determines the types of parameters that are
supplied in the parameter call. If among all the methods called f
there is a unique method whose parameter types are best match for the
supplied parameters, then that method is choosen to be called. This
process is called overloading resolution. The situation can get
complex because of type conversions ( int to Double and so on ). If
compiler cannot find any method with matching parameter types or if
multiple methods all match after applying conversions, then compiler
eports an error.
Now the compiler knows the name and parameter types of the method that
needs to be called"
cheers