Welcome back to Java Code Online. Java keywords are those which are defined by the programming language. These keywords are used by programmers to code easily. You cannot use keywords in place of variable names, that is not allowed.
Reserved words in Java are actually words which are reserved by the programming language. It might be, that the meaning of these keywords is not defined by the compiler but they are reserved. So you cannot use these also for your variable names in Java.
A list of Java Keywords and Reserved Words is given below. This list is correct as per the Tiger version of Java, that is Java 2.
List of Keywords and Reserved Words in Java:-
1. abstract
2. class
3. extends
4. implements
5. null
6. strictfp
7. true
8. assert
9. const
10. false
11. import
12. package
13. super
14. try
15. boolean
16. continue
17. final
18. instanceof
19. private
20. switch
21. void
22. break
23. default
24. finally
25. int
26. protected
27. synchronized
28. volatile
29. byte
30. do
31. float
32. interface
33. public
34. this
35. while
36. case
37. double
38. for
39. long
40. return
50. throw
51. catch
52. else
53. goto
54. native
55. short
56. throws
57. char
58. enum
59. if
60. new
61. static
62. transient
So now you have got a good idea about the various keywords in Java, so remember to not to use these keywords and reserved words in your code, or be ready for errors. I will discuss most of these Java Keywords in later posts.
I hope that this article on Java Keywords and Reserved words was beneficial to you in providing you enough idea about the keywords used in Java. For more information on Java keep buzzing Java Code Online.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.