Wednesday, 31 July 2019

Keywords in Java

Keywords are reserved words in java which act as a key to code and has the intent of its own use.

Rules for Keywords: 
  1. Keywords should be in lower case letters.
  2. Keywords cannot be used as names for Methods/classes.
Why do we need Keywords?
In java we perform different operations using keywords and following are the purpose and list of keywords:

Creating java files:
1. class 
2. interface
3. enum

Data types:
4. byte
5. short
6. int
7. long
8. float
9. double
10. char
11. boolean
12. void

Memory Location
13. static
14. new

Control Statements
Conditional Statements:
15. if
16. else
17. switch
18. case
19. default
Loop
20. while
21. do
22. for
Transfer
23. break
24. continue
25. return

Accessibility Modifier
26. private
27. protected
28. public

Modifiers
29. static
30. final
31. abstract
32. native
33. transient
34. volatile
35. synchronized
36. strictfp

Object Representation
37. this
38. super
39. instanceof

Inheritance - Relationship
40. extends
41. implements

Package
42. package
43. import

Exception Handling
44. try
45. catch
46. finally
47. throw
48. throws
49. assert

Unused Keywords
50. const
51. goto






Naming conventions in Java

What is the purpose of Naming conventions?

The main purpose of naming conventions is:

  1. Readability
  2. Maintainability
If the teams don't follow the naming conventions the individuals use their own conventions and that will lead to ambiguity to understand the code.

Here are the typical Java naming conventions as per standards which are handy:



Keywords in Java

Keywords are reserved words in java which act as a key to code and has the intent of its own use. Rules for Keywords:  Keywords should ...