A variable declared as final in a member modification cannot be further modified by another modification. All members of a final member are also final, e.g. the fields of a final member that is a record are final.
When we simulate the class AngleInst we see that there is an error, since we try to modify the unit which is declared as final. We also get a warning because a1 and a2 do not have any default values.
Here is another, slightly more advanced, example of the use of final. This example invovles a model that is used as a transfer function within a PI controller.
We see in the instantiaten of Test that an error occurs because we try to modify b, which is declared as final.