- Java follows camel-case syntax for naming the class, interface, method and also variables.
This shows how to maintain naming conventions when we are using JAVA.(Must and should follow)
Type Rules example
Packages : The prefix of a unique package name is always written in all-lowercase : book, project
Classes : Class names should be nouns, in mixed case with the first letter of each
(or) internal word capitalized. Try to keep your class names simple and descriptive. : Class Project, MyFunction etc.
Interfaces
Variables : Methods in mixed case with the first letter lowercase, with the first letter of : myFunction(); run(); getContent(); etc
(or) each internal word capitalized.
Methods
Constants: These should be in uppercase letter only. : WHITE, GREEN, MIN_PRIORITY etc.
Advantage:
- By using standard Java naming conventions, we could make code look much easier to read the program to yourself and also to other programmers.
- Why we are stressing is, in Java Readability is the main thing to consider.
- It makes user understand code in LESS time.