| Java Keywords | ||||
|---|---|---|---|---|
| abstract | default | if | private | this |
| assert | do | implements | protected | throw |
| boolean | double | import | public | throws |
| break | else | instanceof | return | transient |
| byte | enum | int | short | try |
| case | extends | interface | static | void |
| catch | final | long | strictfp | volatile |
| char | finally | native | super | while |
| class | float | new | switch | |
| continue | for | package | synchronized | |
| Reserved keywords (not currently in use) | ||||
| const | goto | |||
| Reserved Literals | ||||
| null | true | false | ||
The bold ones I consider more important since they demark major blocks of code. assert arrived with JDK (Java Development Kit) 1.4. enum arrived with JDK 1.5. const and goto are not currently used. They may be there just in case C++ programmers use them by mistake to enable the compiler to give a more meaningful error message.
| variable | local variable | method | class | inner class | code block | |
|---|---|---|---|---|---|---|
| public | ||||||
| protected | ||||||
| private | ||||||
| abstract | 1 | |||||
| static | ² | |||||
| final | 3 | 4 | 4 | |||
| native | 5 | |||||
| synchronized | ||||||
| volatile | 6 | |||||
| transient | ||||||
| strictfp |
² - static blocks may not occur inside methods.
3 - final methods cannot be overridden in a subclass. This is not the same as C++ const.
4 - you can’t derive from a final class.
5 - implemented in some other language, usually C, C++ or assembler.
6 - May be asynchronously modified by other threads. Volatile is not a substitute for task synchronization.
Table composed by Razvan.
|
|
You can get the freshest copy of this page from: | or possibly from your local J: drive (Java virtual drive/mindprod.com website mirror) |
| http://mindprod.com/jgloss/keyword.html | J:\mindprod\jgloss\keyword.html | |
![]() | ||
| Canadian Mind Products | ||
| mindprod.com IP:[65.110.21.43] | ||
| view Blog | Your face IP:[38.107.179.210] | |
| Feedback | You are visitor number 71,841. | |