So I'm having trouble parsing a double...
Here's my code:
public class DoubleArray
{
static Console c; // The output console
static final int total = 20;
String[] numStr = new String [total];
Double numDouble;
public void getAndStoreInput ()
{
int count = 0;
do
{
c.print ("Enter Double" + (count + 1));
c.print (": ");
while (true)
{
try
{
numStr [count] = c.readLine ();
numDouble = Double.parseDouble (numStr [count]);
if ((numStr [count] = c.readLine ()) == null || count < total)
{
break;
}
count++;
}
catch (NumberFormatException e)
{
new Message ("That's not a number. Please try again.");
}
}
}
while (count < total);
}
Error occurs here:
numDouble = Double.parseDouble (numStr [count]);
I've been able to parse Double before but I don't know why it's erroring now?