怎么在异常处理中添加while???
程序代码:package ew;
import *;
public class Untitled1 {
public static void main(String[] args) {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
try {
System.out.print("请输入(英文或数字):");
String s = (String) br.readLine();
double num = Double.parseDouble(s);
System.out.println("输入的变量是数字");
} catch (IOException e) {
}
catch (Exception ex) {
System.out.println("输入变量不是数字");
}
}
}
当判断输入的变量不是数字时候,程序会提示用户重新输入字符串,接下来该怎么改? (谢谢了,帮帮我!)
[[it] 本帖最后由 hanzhu3366 于 2008-4-17 08:55 编辑 [/it]]








说真的,我们还没有学异常处理,只是在网上找到类似的解答