1、引入命名空间 using System.Collections.Generic;
class PrinterQueue<T>
{
/// <summary>
/// 移除并返回位于队列1 开始处的对象
/// </summary>
/// <returns></returns>
public static T dequeue()
{
return queue.Dequeue();
}
/// <summary>
/// 向队列添加
/// </summary>
/// <param name="obj"></param>
public static void enqueue(T obj)
{
queue.Enqueue(obj);
}
public static Queue<T> getQueue()
{
return queue;
}
private static Queue<T> queue = new Queue<T>();
}