Java: User Input Validation
Whenever a user is asked to provide input, the program should expect errors. This is true for almost any language and almost any case; you should protect your MySQL code from sql-injections, your php input fields from scripts, your javascript from infinite loops, your java code from non-fitting variable type.