+ 4
Explain Final keyword in java?
2 ответов
+ 7
final, when used on a type identifier creates a constant. That constants value can not be changed and will throw an error if attempted.
When the final keyword is used on a classes method, that method can not be overridden in a sub class.
When the final keyword is used on a class, that class can not be inherited from or extended.
+ 1
Final acts as a reserved word in Java that is used before declaring a variable and assigning a value to it. This means the value remains fixed throughout the program.