Core Java Keywords

BEECHTOWN HOSPITAL CORE JAVA By Virendra Patel Join Telegram Channel BEECHTOWN HOSPITAL Reserved words or Keywords

Views 34 Downloads 0 File size 283KB

Report DMCA / Copyright

DOWNLOAD FILE

Recommend stories

Citation preview

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 assert boolean break byte case catch char class const

continue default do double else enum extends final finally float

for goto if implements import instanceof int interface long native

new package private protected public return short static strictfp super

switch synchronized this throw throws transient try void volatile 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 Words

Reserved Literals 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 4. long 5. float 6. double 7. char 8. boolean

8

Reserved words for flow control 1. if 2. else 3. switch 4. case 5. default 6. for 7. do 8. white 9. break 10.continue 11.return

19

Keywords for modifiers 1. public 2. private 3. protected 4. static 5. final 6. abstract 7. synchronized 8. native 9. strictfp 10.transient 11.volatile

30

Keywords for exception handling 1. try 2. catch 3. finally 4. throw 5. throws 6. assert

36

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

42

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

46

return type keyword 1. void

47

Reserved literals

53

1. true 2. false 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