Naming conventions
Keep some basic principles in mind when writing code.
Starting Java programmers make often mistakes in the naming conventions. Which makes their code difficult to read.
Try to keep the following rules in mind when you write your first Java code:
- Start class names with a capital letter.
- Start interface names with a capital letter.
- Start object and variable names with small letter, internal words start with capital letters..
- Encapsulate fields using get and set methods. getVariable() setVariable().
- Methods should be verbs, in mixed case with the first letter lowercase, with the first letter of each internal word capitalized.
- Only use small letters for package names.