28 ConcurrentLinkedDeque

2020-07-24  本文已影响0人  滔滔逐浪
package com.taotao.metithread;

import java.util.concurrent.ConcurrentLinkedDeque;

/**
 *@author tom
 *Date  2020/7/24 0024 7:54
 *
 */
public class Test16 {
    public static void main(String[] args) {
        ConcurrentLinkedDeque waitThread=new ConcurrentLinkedDeque<>();
        waitThread.add("mayikt");
        waitThread.add("meite");
        waitThread.add("xiaowei");
//队列遵循先进先出
        System.out.println(waitThread.peek());
        System.out.println(waitThread.size());
    }
}


上一篇下一篇

猜你喜欢

热点阅读