I found a wonderful article while I was tracing an error in my code. Here is the article Top Ten Errors Java Programmers Make. Can you believe, I did the number one error among the listed top ten errors!!! :(
According to the author, Below are the top ten mistakes that java programmer do while they do coding. So look at them and stop doing the same error again and again :)
10. Accessing non-static member variables from static methods (such as main)
9. Mistyping the name of a method when overriding
8. Comparison assignment ( = rather than == )
7. Comparing two objects ( == instead of .equals)
6. Confusion over passing by value, and passing by reference
5. Writing blank exception handlers
4. Forgetting that Java is zero-indexed
3. Preventing concurrent access to shared variables by threads
2. Capitalization errors
1. Null pointers!
For details, please visit the original article.