final fields do not allow you to change the field itself (making it a βpointβ for any other instance), but if the field is a reference to a mutable object, nothing will stop you from doing this:
public void someFunction (final Person p) { p = new Person("mickey","mouse");
the link p above is unchanged, but the actual person referenced by the link is volatile. you can, of course, make the Person class an immutable class, for example:
public class Person { private final String firstName; private final String lastName; public Person(String firstName, String lastName) { this.firstName = firstName; this.lastName = lastName; }
such classes, when they were created, cannot be changed in any way.
radai source share