final

A Java keyword meaning cannot be changed further: a final field is assigned once, and a final class cannot be extended.

In more detail

A final field must be set by the end of the constructor and can never be reassigned, though the object it refers to may still be mutable. Records make all their fields final. In a sealed hierarchy, final on a permitted class ends inheritance there.

Example

private final Clock clock;

Related terms

Taught in

References

Certification courses