Top 10 Errors Java Programmers Make

Beginners mistake

This article at JavaCoffeeBreak describes 10 errors ostensibly made by Java programmers.

The errors include: forgetting that Java is zero-indexed; comparison assignment (= rather than ==); comparing two objects (== instead of .equals); and mistyping the name of a method when overriding.

That last one is almost redundant nowadays if you’re using a good IDE. The IDE will show a little icon next to the method name, if it’s overriding a parent method. If the name is misspelt, then the little icon won’t appear.

Method overriding highlighted in the NetBeans IDE

Actually, if a programmer was still making these mistakes a year or two after learning Java, I’d be worried. But these are all common pitfalls that beginning programmers make – so from that perspective, it’s a useful list to point the junior coders in your team towards (or senior programmers who are cross-training to Java, of course).

About the Author

Matt Stephens is a senior architect, programmer and project leader based in Central London. He co-wrote Agile Development with ICONIX Process, Extreme Programming Refactored, and Use Case Driven Object Modeling with UML - Theory and Practice.