Keyword modifier for variable, method, or class declarations. In the case of a variable, it indicates that the variable cannot be re-initialized after the original declaration. For a method, it indicates that the method may not be overridden by a subclass. For a class, it indicates that the class may not be extended by a subclass.
indicates a variable or object, a method or a class that cannot be changed. Can create a manifest constant or, in the case of a â€œblankâ€ final, can be initialized at a later point as appropriate. private final int NIL = 0; public static final int HALVES = 2; final Shape pentagon = new Shape(5); private final starting_amount;
A Java keyword. You define an entity once and cannot change it or derive from it later. More specifically: a final class cannot be subclassed, a final method cannot be overridden and a final variable cannot change from its initialized value.