Tuesday, 17 October 2017

Final keyword
                          Final keyword can be used before local variable ,instance variable,static variable,class and method.
Before instance variable
                                         because of using final keyword before instance variable , it can be initialized in two way 1 in statement itself for eg public int x=10;2 by making constructor

before static variable 
                                     Variable can be initialized in two way 1 with final keyword and by making static block
3
Before local variable 
                                     It can be initialized with final keyword itself and after that it can't be changed.
before method  
                    Method can not be overridden .
Before class
                   Class can't have its subclass and can't extends


For next "This" keyword See my next blog
                       

1 comment: