(e-mail address removed) coughed up:
....[rip]...
Thanks. I think I'll look for some more reviews of this book. I'm
mostly thinking about the negative comment I read about the section
on Swing.
Well, while I'm at it, I figured it made sense to enter in the only other
[big] mistake that he made in the 4th edition. He completely botches what
is meant by "pass by reference".
Here is a partial quote:
<*DISAPPOINTING* quote from 4th edition, Ch.2, page 48>
[...]
"Passing by reference" means that a reference to (i.e. the
address of) the argument is passed to the method.
[...]
What's really going on here is that a copy of the value that
references an object argument is passed to the method.
This is why some java books say "everything is passed by
value"---the object reference is passed by value which
effectively passes the object itself by reference.
</*DISAPPOINTING*>
This is of course a disaster. The statement "the object reference is passed
by value" is indeed correct. But to add "...which effectively passes the
object itself by reference" is *dead* *wrong*.
It does not effectively do that at all since "passing an object by
reference" still has a distinct meaning in computer science completely
contrary to the "reference being passed by value". Adding the word
"effectively" does not make it so! Passing by reference (even "effectively"
so) means that the method can use the formal parameter on the LHS of an
equation to change the actual parameter!
I'm preaching to the choir in this newsgroup, but consider that method()
cannot do anything to the actual parameter.
public void method(Object o)
{
o = null;
}
Object obj = new Object();
method(obj);
// obj is not null at this point!
I really hope he fixed this in later versions.
But again, I still strongly recommend his book for the reasons I previously
described.
....[rip]...