Re: Top Ten Errors Java Programmers Make



Additya wrote:
Hello friends , Here is a nice article which I have found while
surfing , it is about the ten common errors which may be made by any
Java Programmer while Programming. The article lists all those
mistakes and their solution.
http://www.ezdia.com/Top_Ten_Errors_Java_Programmers_make/Content.do?id=839

No comment about whether these are or are not truly the
"top ten," except to note that the article makes no mention
of any kind of quantitative survey.

However, the article looks awfully old and some of its
advice is out of date. For example, error #9 (mistyping a
method name -> failure to override) says that the only way to
catch the problem is to notice that your "overriding" method
doesn't actually get called. In modern Java you'd use an
@Override annotation, and the compiler would catch the error.
(Also, examples based on AWT are just a wee bit antiquated.)

Error #6 (pass by reference or by value) has an explanation
that I think just adds to confusion. It seems to me more helpful
to say that Java *always* passes by value, but that some of those
values *are* references. Since he's just made the point about
reference values in error #7 (mixing up == and .equals), it's a
shame he didn't follow through.

--
Eric Sosman
esosman@xxxxxxxxxxxxxxxxxxxx
.