0% found this document useful (0 votes)
89 views2 pages

Java Identifiers and Key Words

Java identifiers can contain letters, numbers, $, and _ but cannot start with numbers. There are 53 keywords in Java including data type keywords like int and double, flow control keywords like if and else, and class-related keywords like class and interface. Modifiers include keywords like public, private, and static that define attributes of classes and members.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
89 views2 pages

Java Identifiers and Key Words

Java identifiers can contain letters, numbers, $, and _ but cannot start with numbers. There are 53 keywords in Java including data type keywords like int and double, flow control keywords like if and else, and class-related keywords like class and interface. Modifiers include keywords like public, private, and static that define attributes of classes and members.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

--------------------------------------

-- Rules of defining Java Identifiers


--------------------------------------
* Only allowed characters in java identifiers are
1) a to z
2) A to Z
3) $
4) _
* Identifiers cant start with numbers.
- total123 -- valid --
- 123Total -- in-valid --
=======================================================
--------------
-- Key words
--------------
- 53 key words
- 3 Reserved literal key words
1) true
2) false
3) null
- 50 Keywords
- 2 unused
1) goto
2) const
- 48 used key words
---------------------------------------------------------
Data types KW
1) byte
2) short
3) int
4) long
5) float
6) double
7) char
8)boolean

KW for flow control


1. if
2. else
3. switch
4. case
5. default
6. while
7. do
8. for
9. break
12. continue
11. return

Modifiers
1. public
2. private
3. protected
4. default
5. static
6. final
7. abstract
8. synchroinized
9. native
10. strictfp
11. transient
12. volatile

KW for exceprion handeling


1. try
2. catch
3. finally
4. throw
5. throws
6. assert

Class related
1. class
2. interface
3. extends
4. implements
5. import
6. package

Object related KW
1. new
2. instanceof
3. super
4. this

"void" return type

goto, const

true, false, null

enum

You might also like