Doubt in compiling the code

I am not able to understand the code compilation ,please tell the error in my code and suggest changes.

@Adhyayan,
Please share your code as well.

import java.util.*;
public class Main {

public static void main(String[] args) throws Exception {
	// TODO Auto-generated method stub
	Scanner s = new Scanner(System.in);
	
	int n = s.nextInt();
	Main mainobj = new Main();
	StacksUsingArrays stack = mainobj.new StacksUsingArrays(1000);
	StacksUsingArrays stack2=mainobj. new StacksUsingArrays(1000);
	public  void enqueue(int n) throws Exception{
		int c=0;
		while(c<n){
			while(!stack.isEmpty()){
				stack2.push=stack.pop();
			}
			stack.push(c);
			while(!stack2.isEmpty()){
				stack.push=stack2.pop();
			}
			c++;
		}

	}
	public  void dequeue() throws Exception{
		while(!stackisEmpty()){
			int ans =stack.pop();
		    System.out.print(ans+" ");

		}
	}
		




private class StacksUsingArrays {
	private int[] data;
	private int tos;

	public static final int DEFAULT_CAPACITY = 10;

	public StacksUsingArrays() throws Exception {
		// TODO Auto-generated constructor stub
		this(DEFAULT_CAPACITY);
	}

	public StacksUsingArrays(int capacity) throws Exception {
		if (capacity <= 0) {
			System.out.println("Invalid Capacity");
		}
		this.data = new int[capacity];
		this.tos = -1;
	}

	public int size() {
		return this.tos + 1;
	}

	public boolean isEmpty() {
		if (this.size() == 0) {
			return true;
		} else {
			return false;
		}
	}

	public void push(int item) throws Exception {
		if (this.size() == this.data.length) {
			throw new Exception("Stack is Full");
		}
		this.tos++;
		this.data[this.tos] = item;
	}

	public int pop() throws Exception {
		if (this.size() == 0) {
			throw new Exception("Stack is Empty");
		}
		int retVal = this.data[this.tos];
		this.data[this.tos] = 0;
		this.tos--;
		return retVal;
	}

	public int top() throws Exception {
		if (this.size() == 0) {
			throw new Exception("Stack is Empty");
		}
		int retVal = this.data[this.tos];
		return retVal;
	}

	public void display() throws Exception {
		if (this.size() == 0) {
			throw new Exception("Stack is Empty");
		}
		for (int i = this.tos; i >= 0; i--) {
			System.out.println(this.data[i]);
		}

	}

}

}

@Adhyayan,
Here is your correct code: https://ide.codingblocks.com/s/205427
Please create different classes of stack and Main.

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.