Define a fixed-size list in Java -


is possible define list fixed size that's 100? if not why isn't available in java?

yes,

commons library provides built-in fixedsizelist not support add, remove , clear methods (but set method allowed because not modify list's size). in other words, if try call 1 of these methods, list still retain same size.

to create fixed size list, call

list<yourtype> fixed = fixedsizelist.decorate(arrays.aslist(new yourtype[100])); 

Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -