Array-based queue implementation
Don't Repeat Yourself (DRY)


    public void enqueue(int valueToAdd){
        if(amountInQueue == queue.length){
            throw new FullQueueException();
        }
        else if(rearIndex == queue.length -1){
            rearIndex = 0;
            queue[rearIndex] = valueToAdd;
            amountInQueue++;
        }
        else if(amountInQueue == 0){
            queue[rearIndex] = valueToAdd;
            amountInQueue++;
        }
        else{
            rearIndex++;
            queue[rearIndex] = valueToAdd;
            amountInQueue++;
        }
    }



There's some duplicate code here.  Consider 

    public void enqueue(int valueToAdd) {
        if(amountInQueue == queue.length) {
            throw new FullQueueException();
        }

        if (rearIndex == queue.length -1) {
            rearIndex = 0;
        }
        else if (amountInQueue == 0) {
            frontIndex = 0;
            rearIndex = 0;
        }
        else{
            rearIndex++;
        }

        queue[rearIndex] = valueToAdd;
        amountInQueue++;
    }


You don't need to use an else after you throw an exception, as it will leave the function immediately.  

More importantly, other than the exceptional case, all the cases have the same two lines.  So take them out of the if/else construct.  In the empty queue case, there's nothing left.  You can clear the front and rear indexes if you want.  Or you can remove that case entirely.  


    public int dequeue(){
        int frontValue = frontIndex;
        if(amountInQueue == 0){
            throw new EmptyQueueException();
        }
        if(frontIndex == queue.length -1){
            frontValue = queue[frontIndex];
            frontIndex = 0;
            amountInQueue--;
        }
        else{
            frontValue = queue[frontIndex];
            frontIndex++;
            amountInQueue--;
        }
        return frontValue;
    }



Similarly, this could just be 

    public int dequeue(){
        if (amountInQueue == 0) {
            throw new EmptyQueueException();
        }

        frontValue = queue[frontIndex];
        amountInQueue--;
        frontIndex++;
        if (frontIndex == queue.length) {
            frontIndex = 0;
        }

        return frontValue;
    }


You don't have to set the return value before the exceptional case, as it won't be used if the exception is thrown.  

Only the modifications of frontIndex need to be in the if/else.  

If you always increment, then you don't have to subtract in the comparison.  Saving one math operation in the common case and using the same number in the uncommon case.  

Interfaces

There is a Queue interface.  You might consider having this code implement that interface.  That will force you to name the operations as expected.  

public class Queue2 implements Queue {


As is, someone used to the other queue might have trouble finding the equivalents of add, remove, and peek.  

Bug?

In your valueAtFront and valueAtRear methods, you don't verify that there are elements in the queue.  So these may return garbage.  They should either throw an exception or return something like null when the queue is empty.  

Resize

It's pretty common to allow queues to resize.  Something to consider for future development.