This exercise lets instructors see how well students can properly name methods, classes, and variables in Java.
For each class, function, or variable, place a plus (+) or minus (-) in each column to indicate if it meets the requirement for that column. The first column asks if the name is valid in Java. The second asks if the name is concise. The third asks if the name is descriptive for its use. Finally, the fourth column asks if the name meets the Java Naming Convention. You may use a not applicable (n/a) where you deem appropriate.
| Valid? | Concise? | Descriptive? | Meets JNC? | |
| EX. class CF_engine | + | + | - | - |
| 1. Monkey mr_bananas | ||||
| 2. Double area() | ||||
| 3. class TouchSensor | ||||
| 4. Boolean switch | ||||
| 5. int numberOfYoungCanines | ||||
| 6. Integer SUM() | ||||
| 7. class Unit | ||||
| 8. class ProbablityCalculatorModule | ||||
| 9. constant int TOTAL__PUPPIES | ||||
| 10. double r | ||||
| 11. double LMultipliedByW() | ||||
| 12. int i (in a forloop) | ||||
| 13. boolean switchOn | ||||
| 14. class Funny_Monkey | ||||
| 15. int 2ToTheN(int n) |
| Valid? | Concise? | Descriptive? | Meets JNC? | |
| EX. class CF_engine | + | + | - | - |
| 1. Monkey mr_bananas | + | + | + | - |
| 2. Double area() | + | + | + | + |
| 3. class Touch-Sensor | - | + | + | n/a |
| 4. Boolean switch | - | + | - | + |
| 5. int numberOfYoungCanines | + | - | + | + |
| 6. Integer SUM() | + | + | - | - |
| 7. class Unit | + | + | - | + |
| 8. class ProbablityCalculatorModule | + | - | + | + |
| 9. constant int TOTAL__PUPPIES | + | + | + | + |
| 10. double r | + | + | - | + |
| 11. double LMultipliedByW() | + | - | - | + |
| 12. int i (in a for-loop) | + | + | + | + |
| 13. boolean switchOn | + | + | + | + |
| 14. class Funny_Monkey | + | + | + | - |
| 15. int 2ToTheN(int n) | - | n/a | + | n/a |
The following must be done out of class:
In-class feedback can be done by having students write their own answers, but caution must be taken to avoid embarassing or ridiculing a student for making mistakes. For some names, there might be debate over how concise or descriptive the names are. For example, double r could be descriptive if it's a member variable in class Circle.