What does the final keyword say

The final modifier can be applied to variables, method parameters, class fields and methods, or the classes themselves.

  • The class cannot have descendants;
  • The method cannot be overridden in inherited classes;
  • The field cannot change its value after initialization;
  • Method parameters cannot change their value inside a method;
  • Local variables cannot be changed once a value has been assigned to them.

Read also:


Comments

Popular posts from this blog

Methods for reading XML in Java

XML, well-formed XML and valid XML

ArrayList and LinkedList in Java, memory usage and speed