You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Most classes that are not simply utility classes containing static methods contain properties that could be marked 'final' to make them immutable. Up until now, I have been avoiding declaring these fields 'final' because they might be given by the textbook as mutable variables.
However, this generates compiler warnings. Adding 'final' does not affect the semantics of the code, but does clarify that they are never modified.
At what point in the textbook is the keyword 'final' explained? Is it acceptable to declare these final?
The text was updated successfully, but these errors were encountered:
Most classes that are not simply utility classes containing static methods contain properties that could be marked 'final' to make them immutable. Up until now, I have been avoiding declaring these fields 'final' because they might be given by the textbook as mutable variables.
However, this generates compiler warnings. Adding 'final' does not affect the semantics of the code, but does clarify that they are never modified.
At what point in the textbook is the keyword 'final' explained? Is it acceptable to declare these final?
The text was updated successfully, but these errors were encountered: