can any one please correct this code dont know the problem
/* package codechef; // don't place package name! */ import java.util.Scanner; /* Name of the class has to be "Main" only if the class is public. */ class Queue { int f = -1, r = -1; int n = 10; int q[] = new int[n]; void isFull() { if (r == (n - 1)) { System.out.print("Queue is full"); } else { Scanner sc = new Scanner(System.in); System.out.print("Enter Data"); int i = sc.nextInt(); if (f == -1 && r == -1) { f = 0; r = 0; q[r] = i; // contains the data that user will insert sc.close(); } else { r = r + 1; q[r] = i; } } } void isEmpty() { if (f == -1 && r == -1) { System.out.print("Queue is empty"); } else { f = f + 1; } } void display() { System.out.print("items are: "); for (int i = f; i <= r; i++) { System.out.println(q[i]); } } public static void main(String[] args) { int d; Scanner sc = new Scanner(System.in); Queue s = new Queue(); int l; do { System.out.print("Press 1 to Enqueue "); System.out.print("Press 2 to Dequeue "); System.out.print("Press 3 to Display "); System.out.print(" Enter your Choice "); d = sc.nextInt(); switch (d) { case 1: { s.isFull(); break; } case 2: { s.isEmpty(); break; } case 3: { s.display(); break; } } System.out.println("Enter 0 to go back to the main menu"); System.out.println("Enter any key to exit");