SPIRO THE TECH GURU

Back

What is the Advantage of naming conventions?

By Admin on

By using standard Java naming conventions, you make your code easier to read for yourself and for other programmers. Readability of Java program is very important. It indicates that less time is spent to figure out what the code does.

NameConvention
class nameshould start with uppercase letter and be a noun e.g. String, Color, Button, System, Thread etc.
interface nameshould start with uppercase letter and be an adjective e.g. Runnable, Remote, ActionListener etc.
method nameshould start with lowercase letter and be a verb e.g. actionPerformed(), main(), print(), println() etc.
variable nameshould start with lowercase letter e.g. firstName, orderNumber etc.
package nameshould be in lowercase letter e.g. java, lang, sql, util etc.
constants nameshould be in uppercase letter. e.g. RED, YELLOW, MAX_PRIORITY etc.
SPIRO Google Plus