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
本文参考链接:https://www.cnblogs.com/maohuidong/p/15272317.html