Skip to main content

Posts

Showing posts with the label Naming Conventions

Naming Conventions in Java

Naming Conventions in Java As the movies are rated G, PG, U, A depending on the age restriction and by just gazing through the rating our parents decide the movie to watch together, or a book with diffrent labels to keep track of the sections and just by seeing them we know what they represent, the same labeling method has been introduced by Java team to diffrenciate variables, methods, classes, constants etc.. and we will be going through them all here. Type Naming Convention Example Variables Must start with a lower case and every other word capitalized int counter; Constants Must all be upper case and _ for diffrenciating every other word final int MAX_HEALTH = 100; Methods Must start with a lower case and every other word capitalized. can be distingiused from the variable by the () next to the method name void printNum(){..} Class Must start an upper case letter and every other word must