Common Errors and Mistakes
- Using == instead of equals() for comparing the contents of objects (like strings)
- Trying to access an instance variable in a static method (like main)
- Forgetting a cast when pulling an object out of a collection
- Off by one errors (index of an array or start or end of a loop)
- Null pointer exceptions. Declaring an object reference doesn't create the object!
- Wrong case for keywords (should be all lowercase)
- Wrong case for class names (should start with an uppercase letter)
- Wrong case for fields and methods (should start with an lowercase letter). The first letter of each additional word should be uppercase.
Link to this Page
- Java Resources last edited on 14 September 2010 at 8:22 pm by user-112155i.dsl.mindspring.com