Rules for identifier names (enforced by Java)


An identifier
Unique Special rule Explained in video*
Variable unique in its scope Lesson 23
Constant unique in its scope Lesson 236
Method unique in its scope Lesson 96
Class unique in its package has to match the filename Lesson 146
Package unique has to match the directory structure Lesson 184

Conventions for identifier names (recommended)


Upper / lower case Word separation Mutations Name usually contains Examples Explained in video*
Variable Start with a lower case letter CamelCase No noun menuSelection, bestProgrammingLanguage Lesson 23
Constant Are all in upper case letters Underscores No noun SELECTION_MENU, MY_CONST_VALUE Lesson 236
Method Start with a lower case letter CamelCase No verb printMenu(), listVehicleCategories() Lesson 96
Class Start with an upper case letter CamelCase No noun VehicleTrade, MySpecialClass Lesson 146
Package Are all in lower case letters Underscores No com.jtrainer.jnewcomers.vehicle_trade Lesson 184
* Please buy the course Java for newcomers and log in to udemy.com to watch the explanation videos.