- Every high-level language is composed of keywords. These words are built-in parts of the language.
- Words which are created by programmers are called identifiers. Java identifiers may be any length. They may start with a letter, underscore, or dollar sign, and may be composed of any number of letters, digits, and underscores; no other characters (not hyphens, not blank spaces) may be used. We will limit the starting character of our identifiers to a letter.
- Identifiers are used to name classes, methods, fields, variables, and constants.
- By convention
- class identifiers start with a capital letter and use camelCase as required
- method, field, and variable identifiers start with lowercase letters and use camelCase as required
- constant identifiers are all in CAPITAL_LETTERS and use underscores as required
- Our goal is meaningful and descriptive identifiers.
- For mutators, method identifiers start with a verb describing the action performed by the method. For accessors, method identifiers either start with “get” or describe the value returned.
- All of our programs follow our course Style Guide.
[This page last updated 2020-12-23 at 12h13 Toronto local time.]
© 2007–2021 Hersch, Bear & Company Limited. All rights reserved. “Grammar Authority,” “grammarauthority.com,” “touque.ca,” and “Canada’s Thinking Cap” are trademarks of Hersch, Bear & Company Limited. All other trademarks and copyrights are the property of their respective owners.