The
Java keyword 'final' is used for several purposes: if you make a class final, it means the class can't be extended (you can't subclass it).
A final member variable is a variable that can only be initialized once - it's value can't be modified after initialization.
Immutable is not a Java keyword. When a class is immutable, it means that if you have an instance of the class, the value that that object represents can't be modified.
Examples of immutable classes in the Java standard API are class
String and the primitive wrapper classes (Integer, Long, Byte etc.). It's important to keep in mind that those classes are immutable if you're working with them. Class String contains some methods that perform operations on the content of the string (for example, toUpperCase(), etc.) but those methods always return a new String object, and do not modify the original String object. People who don't know that often make mistakes like this: