-
-
Notifications
You must be signed in to change notification settings - Fork 4
final
pannous edited this page Dec 25, 2023
·
2 revisions
As with mutability, there are two kinds of constance:
- constant variables point to the same objects during their lifetime.
- constant objects don't change (their inner value) during their lifetime.
To simplify the situation, Angle offers the final
keyword which means both:
final x = Node()
x = 7 // error can't change variable x
x.y=z // error can't change Node x