Final Keyword in java

Jun 22nd, 2011No Comments

Final

    Final is keyword in java

Final With Variable

    Final Variable can be declared either block level or instance level
    Final Variable can be initialized only once. Re-initialization causes a compile time error

Final Method

    Final Methods behaves like constants these methods are not allowed to override in child classes
    Final Methods won’t participate with abstract,private Keywords

Final Class

    Final Class behaves like constant
    Final Class can’t act as a base class in inheritace
VN:F [1.9.10_1130]
Rating: 9.8/10 (5 votes cast)
VN:F [1.9.10_1130]
Rating: +5 (from 5 votes)

Final Keyword in java, 9.8 out of 10 based on 5 ratings

About author:

All entries by

Leave a Reply