Java Naming conventions: A naming convention is a rule to follow as you decide what to name your identifiers e.g. class, package, variable, constant, method etc.
But, it is not forced to follow. So, it is known as convention not rule.
Advantage of naming conventions in java
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.
|class name||should start with uppercase letter and be a noun||String, Color, Button, System, Thread etc|
|interface name||should start with uppercase letter and be an adjective||Runnable, Remote, ActionListener etc.|
|method name||should start with lowercase letter and be a verb||actionPerformed(), main(), print(), println() etc.|
|variable name||should start with lowercase letter||firstName, orderNumber etc|
|package name||should be in lowercase letter||java, lang, sql, util etc|
|constants name||should be in uppercase letter||GREEN,RED, YELLOW, MAX_PRIORITY etc.
Core Java Interview Questions
Object Oriented Programming(OOP) Questions and Answers
Collections Interview Questions
Java Exceptions Interview Questions
Java Threads Interview Questions
Collection framework in java interview questions
oops concepts with example in java
Java Serialization Interview Questions
Top 20 Core Java Interview Questions with Answers
String Interview Question in java With Example
synchronization interview questions
Java Reflection Interview question
Java Executor Framework (JDK 1.5) Interview Questions
JDK 1.7 interview Questations and Answers
Java I/O interview question with example