Reserved Words:
-------- 1.2 version
In java, some words are reserved to represent some meaning or functionality such types of words are called reserved words.
- Data type related keywords:
2. short
3. int
5. long
6. float
7. double
8. char
- Flow control-related keywords:
2. else
3. switch
4. case
5. default
6. do
7. while
8. for
9. continue
10. return
11. break
- Modifiers related keywords:
2. private
3. protected
4. static
5. final
6. abstract
7. synchronized
8. native
9. strictfp
10. volatile
11.transitive
- Exception related keywords:
2. catch
3. finally
4. throw
5. throws
6. assert
- class-related keywords:
2. interface
3. extends
4. implements
5. package
6. import
- object-related keywords:
2. instanceof
3. super
4. this
- return type keyword:
goto and const are unused keywords. If we use it, we will get a compile-time error.
- enum keyword ( included from 1.5 version):
# Conclusion:
- All 53 reserved words in java contain only lowercase alphabets symbol.
- In java, we have the only new keyword and there is not delete keyword. Because destruction of useless objects is the responsibility of Garbage Collector.
- The following are the new keyword in java.
assert ---------- 1.4 version
enum ---------- 1.5 version
Que :- Which of the following are valid Java reserved words?
public valid
static valid
main Invalid
String invalid
void valid
args Invalid
Comments
Post a Comment