arraylist - How to create a read-only list in java without using unmodifiablelist method from collections API? -
an interviewer asked me question create read-only list in java without using collections api method.any thoughts on how can achieve ?
just extend abstractlist
, , docs mention:
to implement unmodifiable list, programmer needs extend class , provide implementations get(int) , size() methods.
Comments
Post a Comment