public static void main(String[] args) throws InterruptedException {
CircularFifoQueue queue = new CircularFifoQueue(5);
for(int i = 0;i < 10;i++) {
queue.add(i);
System.out.print(queue);
Thread.sleep(2000);
}
}

参考:https://yuanmomo.net/2019/06/25/java-fixed-queue/

https://blog.csdn.net/liuxiao723846/article/details/81782507

https://my.oschina.net/MStart/blog/518216
posted on 2021-09-15 15:08  毛会懂  阅读(1081)  评论(0编辑  收藏  举报