Circular Queue Implementation Using Array in java Here is my code of Array Implementation of Queue in java.

import java.util.Scanner;
class CircularQueue
{
int maxSize;
int rear;
int front;
int aQueue[];
{
    rear = -1;
    front = -1;
}
CircularQueue(int maxSize)
{
    this.maxSize = maxSize;
    this.aQueue = new int[maxSize];
}
void enQueue(int item)
{
    if(((rear+1) % maxSize) == front)
    {
        System.out.println("Queue is Full");
    }
    else
    {
        if (rear == front &amp;&amp; front == -1)
        {
            front += 1;
        }
        rear = (rear+1) % maxSize;
        aQueue[rear] = item;
    }
}
void deQueue()
{
    if(rear == front &amp;&amp; rear == -1)
    {
        System.out.println("Queue is Empty.");
    }
    else
    {
        int item = aQueue[front];
        if(rear == front)
        {
            rear = -1;
            front = -1;
        }
        else
        {
            front = (front + 1) % maxSize;
        }
        System.out.println(item + " is deQueued from the Queue");
    }
}

String elementOrElements()
{
    String send = (rear == front)? (" ") :("s ");
    return send;
}

void display()
{
    int tmpfront = front;
    if(rear == front &amp;&amp; rear == -1)
            {
                    System.out.println("Queue is Empty.");
            }
            else
    {
        System.out.println("The element"+ elementOrElements() + "on the Queue are:- ");
        for(int i=0; i&lt;maxSize ; i++)
        {
            if(tmpfront != rear)
            {
                System.out.println(aQueue[tmpfront]);
                tmpfront = (tmpfront + 1) % maxSize;
            }
            else
            {
                System.out.println(aQueue[rear]);
                break;
            }
        }
    }
}
public static void main(String []args)
{
    Scanner input = new Scanner(System.in);
    System.out.print("Enter total no of elements to be in the queue:- ");
    int maxSize = input.nextInt();
    CircularQueue queue = new CircularQueue(maxSize);
    int select;
    int term = 0;
    while (term == 0)
    {
        System.out.print("\nOption:\tTo Do:\n1\tTo push element.\n2\tTo POP element.\n3\tTo Display the Queue elements.\n4\tTo Exit the Program.\nEnter your option:- ");
                select = input.nextInt(); 
        switch(select)
        {
            case 1:
            {
                System.out.print("Enter element to insert in the Queue:- ");
                int ele = input.nextInt();
                queue.enQueue(ele); 
                break;
            }
            case 2:
            {
                queue.deQueue();
                break;
            }
            case 3:
            {
                queue.display();
                break;
            }
            case 4:
            {
                term = 1;
                System.out.println("Thank you!");
                break;
            }
            default:
                System.out.println("Enter a valid options");
        }
    }
  }
}


Is there anything I can do to improve it? Code written for DSA class practical.
Since this is in Java and for academic purposes, my guess would be that you're using Eclipse. Hit CTRL+SHIFT+F to format your code, and move any lines that it chops up back into one where appropriate. The key binding is similar for Netbeans and IntelliJ's IDEA.
Too many useless variables. You have a bad habit of creating variables for one off-uses, e.g. in elementOrElements(). Just return what send equals. If you want to describe what the code does, then use comments (which you don't use at all in your implementation btw).
If the functionality isn't obvious, then use comments. Most programmers can discern what generic methods and operations look like, but when in doubt comment. Remember that you're writing software primarily for other humans. This is critical in a professional environment.
Delete elementOrElements(). In the single print call in which it's used, just say, The contents of the Queue are:.
Consistent variable naming is required. You have tmpfront, which should be tempFront according to Java conventions. Not a huge deal since you seem to adhere to this throughout the program. I add the extra e out of personal preference (and the fact that it helps other humans ever so slightly).
Use proper Queue naming conventions, i.e. use enqueue instead of enQueue. Creating a couple of helper methods like isEmpty() and isFull() would help your implementation in a couple of places.
Move CircularQueue to CircularQueue.java and add some public modifiers to your methods. This is mainly for convention training.