FINAL keyword in Java Language

Last time we discussed about the this keyword. Today we will discussed about another keyword called final. So note down the important points of the final keyword: -

  1. Final is a keyword which can be used with variables, methods and classes.
  2. If we declare any variable as final, it will be constant.
  3. If we declare any method as final, it cannot be overridden.
  4. If we declare any class as final, it can’t be inheritance.
  5. Final is the only modifier which can be used with local variables.
  6. Delay initialization of final variable are possible only within constructor.
  7. Final variables will never get default variables.


Share this Post[?]
        

2 Comments so far

  1. [...] friends, in the last post we discussed about important points of final keyword. Now we are going to practically prove all the points of the final keywords. If I leave any [...]

  2. Meher on October 22nd, 2009

    Hi
    I m software engg i studey different tutorial. its very intersting i want to study u r complete java tutorial. if you send me this will be pleasure for me
    thanks in advance

    Regards,

    meher

Leave a reply