right... yes I didn't mean to extend the tangent, but you know... I got interested in it...
anyway as it has been stated before, the right way to write this program would be something like this with error handling:
Code:
int max = 0;
boolean reading = true;
while(reading) {
int n = Integer.parseInt(JOptionPane.showInputDialog("Number:"));
if(n > max) max = n;
if(n == 0) reading = false;
}
JOptionPane.showMessageDialog("Max was " + max);
Thanks for the introspective aluser, very interesting.
B.