Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
bvrmn
· 2mo ago · 0 comments
ArrayList is a very generic (pun not intended) structure and could be stretched quite freely in any direction with useful property of owning underlying slice. Like readonly preallocated ArrayList is a thing.
Comments
[–]
_bohm
2mo ago
That's a good point. Using lockPointers would be a good way to enforce at runtime that your ArrayList is truly read-only.