Q:

How to stop my do while loop from accepting every single string except "stop"

Write a main method that asks the user for an integer n which then allocates an array of ints of that size and stores that many integers as the user enters them. Once they are all entered, print them in the reverse order of how they were entered.

This is what I have come up, thus far (any help will be greatly appreciated):
import java.util.ArrayList;
import java.util.InputMismatchException;
import java.util.Scanner;
public class Array2D {

    public static void main(String[] args){
        Scanner num = new Scanner(System.in);
        ArrayList<Integer> number = new ArrayList<Integer>();
        int ber = 0;
        String stop = "";

        System.out.println("Type as many number as you like, to get in reverse order. When done typing number, type STOP: ");
        do{
            try{
                ber = num.nextInt();
                number.add(ber);
            }
            catch(InputMismatchException e){
                stop = num.nextLine();
                e.equals(stop);
            }

        }while(!(stop.equalsIgnoreCase("stop")));

A:

Task from your question is asking you to do something like this (there is no even need to handle case where user writes stop or other incorrect data, but you can handle them if you want).
//ask user for array size
int n = getInt();
//create array for n integers
int[] array = new int[n];
//read n integers from user
for (i in 0..n-1)
    tmp = readInt()
    //and store them in array
    put tmp in array at position i

//print content of array backwards
for (i in n-1..0)
    print(i-th element from array)

