Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Declaring properties 'final'. #18

Open
pumken opened this issue Jan 26, 2023 · 0 comments · May be fixed by #22
Open

Declaring properties 'final'. #18

pumken opened this issue Jan 26, 2023 · 0 comments · May be fixed by #22

Comments

@pumken
Copy link
Contributor

pumken commented Jan 26, 2023

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?

@pumken pumken linked a pull request Jan 27, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant