Create fixed size list in java | omt Lab
There are two ways to create fixed size list.
1. Using Arrays.asList(yourArrayObject);
2. Using Apache commons FixedSizeList class.
Here i will explain both methods. Both are almost same.
Let's start with first one. Arrays.asList(yourArrayObject);
Below is the best and simple way to create fixed size list
1 | List<Integer> fixedList = Arrays.asList( new Integer[ 5 ]); |
It will returns fixed size list created from array.
Read full article from Create fixed size list in java | omt Lab
No comments:
Post a Comment