sec queues /array-based queue implementation class aqueue implements queue private static final int defaultsize private int maxsize/maximum size of queue private int front/index of front element private int rear/index of rear element private [listarray/array holding queue elements /constructors aqueue(this(defaultsize)@suppresswarnings("unchecked"/for generic array aqueue(int sizemaxsize size+ rear front listarray ( [])new object[maxsize]/create listarray public void clear(rear front /reinitialize public void enqueue( it/put "itin queue assert ((rear+ maxsize!front "queue is full"rear (rear+ maxsize/circular increment listarray[rearitpublic dequeue(/take element out of queue assert length(! "queue is empty" it listarray[front]front (front+ maxsize/circular increment return itpublic frontvalue(/get front value assert length(! "queue is empty"return listarray[front]public int length(/return length return ((rear+maxsizefront maxsizefigure an array-based queue implementation