3. Identifiers can contain capital
letters, small letters and numbers
Examples of Valid Identifiers :
car
anObject
myPRoGRAM123
bga45WD544 – The identifier need not be
meaningful
4. Identifiers can contain only the special
characters underscore _ and dollar $
Examples of Valid Identifiers :
_aName
Student_Class
Student_
_$_$$_
$ant
Examples of Invalid Identifiers :
Car>Class
%in
5. Identifiers should not start with a
number
Examples of Invalid identifiers :
1Aeroplane
1245
6. Identifiers should not contain
Spaces
Examples of Invalid identifiers :
Student class
A class
7. Keywords cannot be used as
identifiers
Examples of Invalid identifiers :
class
for
Examples of Valid identifiers :
For – for is a keyword but For is not a
keyword
8. Identifiers are case sensitive
Example :
Each of the following identifiers are different
Car
car
CAR
cAR
CaR
9. To learn more about identifiers in Java, read
the following articles :
http://www.javawithus.com/tutorial/the-hello-
world-program
http://www.javawithus.com/tutorial/naming-
conventions-for-identifiers
Learn Java through the tutorials on our
website.
http://www.javawithus.com/tutorial/