0% found this document useful (0 votes)
104 views

Core Java Keywords

This document discusses Java reserved words and keywords. It provides a breakdown of keywords by category such as data types, flow control, modifiers, exception handling, class-related, object-related, and reserved literals. It notes that const and goto are reserved but unused keywords. The document also identifies that the statement "final and finally are not valid keywords" is incorrect.

Uploaded by

debjit
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
104 views

Core Java Keywords

This document discusses Java reserved words and keywords. It provides a breakdown of keywords by category such as data types, flow control, modifiers, exception handling, class-related, object-related, and reserved literals. It notes that const and goto are reserved but unused keywords. The document also identifies that the statement "final and finally are not valid keywords" is incorrect.

Uploaded by

debjit
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

BEECHTOWN HOSPITAL

CORE JAVA

By Virendra Patel
Join Telegram Channel
BEECHTOWN HOSPITAL
Reserved words or Keywords
a keyword is a word that is reserved by a program because
the word has a special meaning.
Every programming language has a set of keywords
cannot be used as variable names.
Keywords are sometimes called reserved names .
Java Language Reserved Words

abstract continue for new switch


assert default goto package synchronized
boolean do if private this
break double implements protected throw
byte else import public throws
case enum instanceof return transient
catch extends int short try
char final interface static void
class finally long strictfp volatile
const float native super while

true, false, and null might seem like keywords, but they are actually literals; you cannot use them as identifiers
in your programs.
Java Language Reserved Words
Reserved Literals
Reserved Words 5.9%

Reserved Literals ( 3 )

Keywords ( 50 )

used ( 48 )

unused ( 2 )
Keywords
94.1%
Reserved words for data types

1. byte
2. short
3. int
8
4. long
5. float
6. double
7. char
8. boolean
Reserved words for flow control
1. if

19
2. else
3. switch
4. case
5. default
6. for
7. do
8. white
9. break
10.continue
11.return
Keywords for modifiers
1. public

30
2. private
3. protected
4. static
5. final
6. abstract
7. synchronized
8. native
9. strictfp
10.transient
11.volatile
Keywords for exception handling

1. try
2. catch
36
3. finally
4. throw
5. throws
6. assert
Class related keywords

1. class
2. package
42
3. import
4. extends
5. implements
6. interface
Object related keywords
1. new
2. this
3. super
46
4. instanceof

return type keyword


1. void

47
Reserved literals

1. true
2. false 53
3. null

Unused keywords
1. goto
2. const

Use final instead of const

Enum
represents a group of constants
Identify the incorrect statement about java
keywords

1. const and goto are reserved keywords and are currently not used


2. true, false and null are not keywords, but they are literals
3. break, continue and return are valid keywords
4. final and finally are not valid keywords

You might also like