What is Final Keyword in Java.. ?
• In the Java Programming Language, the final
Keyword is used in several different contexts to
define an entity which cannot later be changed.
• Any variable referenced as final is called Final
• Blank Final Variable.
• Final variables are by default read only.
Difference between const & Final
• The state of array declared as final can be modified in
• But Same is not possible in C / C++.
• Final method can not be overridden in sub-class.
• In methods private is equal to final, but in variables it
• Final class is complete in nature and can not be sub-
classed or inherited.
• Final and abstract are two opposite keyword and a
final class can not be abstract in Java.
Benefits of Final keyword
• Final keyword improves performance.
• It lets other programmers know that this variable
shouldn't be changed or assigned another value
• It stops you accidentally changing the value.
• It stops people overriding methods when you don't
want them to or they shouldn't.