Before we write our first program in Java, we need to know the way of writing and naming conventions of this language. Use already developed schemes. This will facilitate the work of both us and people who can potentially read our code. Let me point out here what every Java programmer needs to know.

1. The names of the classes begin with a capital letter.

2. We begin the method names with a lowercase letter.

3. The variable names begin with a lowercase letter.

4. If the name consists of several words, then the next word need to start with capital letter.

5. The names of constants are written with BIG letters, and the next word is separated by an underscore.

6. Brackets that open the class or method need to be in the same line.

7. In Java, the size of letters matters!

These are two different variables!

8. The names of variables and parameters can be the same thanks to the use of the this keyword.

I am aware that for the time being these things do not tell you much, but do not worry about it, just return to this lesson from time to time, review your code and ask yourself if you stick to the conventions presented here.


Please enter your comment!
Please enter your name here