This is one of the most frequent errors that we all make. It’s so simple to do, and sometimes one can look at an uncapitalized variable or method and still not spot the problem. I myself have often been puzzled by these errors, because I recognize that the method or variable does exist, but don’t spot the lack of capitalization.
While there’s no silver bullet for detecting this error, you can easily train yourself to make less of them. There’s a very simple trick you can learn :-
- all methods and member variables in the Java API begin with lowercase letters
- all methods and member variables use capitalization where a new word begins e.g – getDoubleValue()
If you use this pattern for all of your member variables and classes, and then make a conscious effort to get it right, you can gradually reduce the number of mistakes you’ll make. It may take a while, but it can save some serious head scratching in the future.
Related Posts
- Preventing concurrent access to shared variables by threads in Java Programming
- Java/J2EE Interview Questions & Answers
- Pass by Value and Pass by Reference in Java
- Java Programming Best Practice Writing blank exception handlers
- Consistency Errors in MS SQL Server 2000
Tags: Capitalization Errors in Java, Java Error Handling, Java Variable Declaration Standard




