Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Stop casting to List (Java).
Collections.emptyList() Collections.singletonList() Collections.unmodifiableList() List.of()
As niftich points out, use the marker interface java.util.RandomAccess, if you want to know if the list allows constant time access.
There are no comments on this comment yet.
Collections.emptyList() Collections.singletonList() Collections.unmodifiableList() List.of()
As niftich points out, use the marker interface java.util.RandomAccess, if you want to know if the list allows constant time access.