Given the program, dbug and modify the application to acquire the following outputs:
40 50 60 70 80
70 80 10 20 60
80 40 50 60 70 80
40 50 60 70 80 40
50 60 70 80 40

import java.io.*;
class Queue
{
private int[] queArray;
private int front;
private int rear;
private int nItems;
//----------------------------------
public Queue(int s)
{
maxSize=s;
queArray=new int[maxSize];
fron=0;
rear=-1;
nItems=0;
}
//---------------------------------
public void insert (int j)
{
if(rear==nItems-1)
rear=-1;
queArray[++rear]=j;
nItems;
//------------------------------------
public int remove()
{
int temp=queArray[rear++];
if(front==maxSize)
rear=0;
niTems--;
return temp;
}
//--------------------------------------
public int peekFront()
{
return queArray[fron];
}
public boolean isEmpty()
{
return (maxSize==0);
}
//---------------------------------------
public boolean isFull()
{
return (nItems==maxSize);
}
//----------------------------------------
public int size()
{
return nItems;
}
//----------------------------------------
class QueueApp
{
public static void main(String[]args)
{
Queue theQueue=new Queue(5);

theQueue.insert(10);
theQueue.insert(20);
theQueue.insert(30);
theQueue.insert(40);

theQueue.remove();
theQueue.remove();
theQueue.remove();

theQueue.insert(50);
theQueue.insert(60);
theQueue.insert(70);
theQueue.insert(80);

while(!theQueue.isEmpty())
{
int n=theQueue.remove();
System.out.print(n);
}
System.out.println(" ")
}
}