DEV Community

Hayes vincent
Hayes vincent

Posted on

Final keyword in java

Final()

In Java, the final keyword is used to denote constants. It can be used with variables, methods, and classes.

Once any entity (variable, method or class) is declared final, it can be assigned only once. That is

-The final variable cannot be reinitialized with another value
-The final method cannot be overridden
-The final class cannot be extended

Referance:

https://www.programiz.com/java-programming/final-keyword

Top comments (0)