Fixed size list java
Ngày đăng:
09/01/2022
Trả lời:
0
Lượt xem:
202
There isnt a class that extends List for which you can set a limit on its size and that it behaves like a Queue object if you add an item beyond its fixed size. In other words, I need a class that
The following code is a possible solution: The argument of the constructor is an integer that sets the size of the List and can not be changed, the class that implements List is initialized in the constructor and in this case is an ArrayList. For example, the code to create an object for 10 Float is FixedList |