public class DoubleArray
{
    static Console c;           // The output console
    static final int total = 20;
    String[] numStr = new String [total];
    static double numDbl;
    static String stop = "";

    public void getAndStoreInput ()
    {
        int count = 0;
        do
        {
            c.print ("Enter number" + (count + 1));
            c.print (": ");

            while ((numStr [count] = c.readLine ()) != stop)
            {
                try
                {
                    numDbl = Double.parseDouble (numStr [count]);
                    count++;
                    break;

                }

                catch (NumberFormatException e)
                {

                    new Message ("Invalid. Please Try Again");
                }

            }

        }
        while (count < total);
    }

Isn't my code supposed to stop getting input when the user just press enter without any characters?

nope ...
you can find the value of 'Enter' online if you want, but it would be easier to just compare to a fixed value to stop (and no, "" is not the value for enter)

next to that: != is not the way you check for not-equality between objects, you would have to use (!a.equals(b))

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.