Interest Ask,
The Java final keyword implies several things:
- You can assign a value only once
- You must assign a variable in the constructor or as part of the declaration.
With # readonly keyword applies basically the same restrictions.
For completeness, let's look at const :
- It can only be assigned once as part of an ad.
- It is essentially static - there is only one of them for all N instances of your class
So - I would say that final is more like readonly.
- Dan
source share