Incremental Java
Java Style Variable Names

Java Style Identifiers

Java has a particular way of writing variable names. This is called Java-style. Style refers to something that is recommended, but not required in Java. In other words, the compiler won't complain if you break style rules. However, other programmers may think you're using "bad" style.

For variable names, Java has the following recommended style.

There is another popular style, but it's most often seen in C programming. In C, you don't use uppercase at all, and separate words using underscores. Thus, you would write num_oranges_in_box.

However, it's so common to see Java style used for Java code, that you're better off leaving not using this style, or leaving it for C programming.