Dequeue efficient queueusing stack

compile error is coming in my code.can u tell me why and tell mecorrect solution

package Lecture10;

public class QUSDequeueEfficient {
DynamicStack primary;
DynamicStack secondary;

public QUSDequeueEfficient() throws Exception {
	// TODO Auto-generated constructor stub
	this.primary = new DynamicStack();
	this.secondary = new DynamicStack();

}

public int size() {
	return this.primary.size();
}

public boolean isEmpty() {
	return this.primary.isEmpty();
}

// o(n) time
public void enqueue(int data) throws Exception {
	while (primary.size() != 0) {
		secondary.push(primary.pop());
	}
	primary.push(data);
	while (secondary.size() != 0) {
		primary.push(secondary.pop());
	}

}

// o(1)
public int dequeue() throws Exception {
	return this.primary.pop();
}

// o(1)
public int front() throws Exception {
	return this.primary.top();
}

// o(n)
public void display() {
	this.primary.display();
}

}

Remove the first line i.e. package…

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.