Our social:

Sunday, 18 October 2015

Day to Day operation in java by using java keywords


Day to Day operation in java by using java keywords
Package creation and uses
Class creation
Variables and method creation
Memory allocation
Controlling and modification
Setting access permission
Setting execution level permission
Establishing inheritance relationship
Representing objects and its member
Handling user mistake

Initially java contains 47 keywords. But 3 other keywords are added in other java releases.
In java 1.2 strictfp is a new keyword added in java keyword list. 
In java 1.4 another new keyword assert is added in keyword list.
In java 1.5 another keyword enum is added in java keyword list.
So, now java has totally 50 keywords to perform special operation. Each keyword has special meaning to perform one task.
Now i am going to show all 50 keyword of java as per their uses.


Package creation and uses (2):
1. Package
2. Import

Class creation (3):
3. class
4. interface
5. enum
Data type and return type
 6. Byte 10. float 12. char
7. Short 11. double 13. boolean
8. Int                     9. long
14. void         // this keyword is only used for return type whereas above 6 to 9 is used for data type                              and also return type.



Memory allocation (2):
      static 
15. new

Control flow statement (11):
    Conditional (5):

  • If
  •                else
  •                switch
  •                case
  •               default
   Looping

  • while
  • do
  • for
   Branching

  • break
  •                 continue
  •                 return
Accessibility Modifier (3):

  • private
  • protected
  • public
Execution Level Modifiers (8):

  • static
  • final
  • abstract

  •   native
  •   transient
  •   volatile
  •   synchronized
  •   strictfp
Establishing Inheritance Relationship (2):

  • extends
  • implements
Representing objects and its member (3):

  • this
  •         Super
  •         instanceof
Exception handling (5+1):
throw try assert
        throws catch
                       finally
Unused but reserved keyword (2):
These two keywords are defined but not implemented (no operation is specified for these keywords)

  • goto
  •         const

Default Literals in java:
     Boolean literals:
true
false
     Null literals of type reference:
null

Why goto and const keyword not implemented?

Sun MS don't want to use these keywords in java language language and also dont want programers use these words as programming element. Because It will be confusion to C and C++ programmer who are comming in java palteform. So These keywords are defined as keywords that compilor will not allow progammer to use them as identifier.

                                                                                     Thank you(Smartyy Sunny)

0 comments:

Post a Comment