Java has strong naming conventions. The compiler won't enforce them, but ignoring them makes your code hard for others to read.
- Classes use PascalCase: every word starts uppercase. Example:
HelloWorld,BankAccount. - Methods and variables use camelCase: first word lowercase, then uppercase. Example:
getBalance,userName. - Constants use ALL_CAPS with underscores. Example:
MAX_SIZE,TAX_RATE. - Packages use all lowercase. Example:
com.myapp.utils.
Names should describe what the thing does. A variable called x tells you nothing. A variable called accountBalance tells you everything.
If your class is bankAccount instead of BankAccount, others will assume it's a variable.