初学者的异常问题?已解决
程序代码如下:class Excep{
int compute(int a,int b){
return a/b;
}
}
class Test{
public static void main(String[] args){
Excep excep=new Excep();
try{
(5,0);
}catch(Exception e){
System.out.print("除数不能为零");
}
}
}
这里怎么编译是总是提示
d:\javawork\Exception.java:1: duplicate class: Excep
class Excep{
^
d:\javawork\Exception.java:7: duplicate class: Test
class Test{
^
Exception.java:12: cannot access Exception
bad class file: d:\javawork\Exception.java
file does not contain class Exception
Please remove or make sure it appears in the correct subdirectory of the classpath.
}catch(Exception e){
^
3 errors
[[it] 本帖最后由 he20041987 于 2008-3-15 20:04 编辑 [/it]]