问一个简单的问题!望赐教!
这个问题(如下代码)用javac TheEception.java后没问题,可是用java TheEceptiion时,出现如下错误:
D:\java>java TheException
Exception in thread "main" java.lang.NoClassDefFoundError: TheException
import java.lang.*;
import java.io.*;
public class TheException
{
public static void main(String args[])
{
TheException te=new TheException();
try
{
te.Function_1();
}
catch(Exception e)
{
System.out.println("the file is not exist");
}
finally
{
System.out.println("the exception dispose is over");
}
}
public void Function_1()throws Exception
{
Function_2();
}
public void Function_2()throws Exception
{
ReadFromFile();
}
public void ReadFromFile()throws Exception
{
String filename="ArcTest.html";
//String filename="ArcTest";
FileInputStream fin=new FileInputStream(filename);
InputStreamReader is=new InputStreamReader(fin);
BufferedReader in=new BufferedReader(is);
String str="";
while((str=in.readLine())!=null)
{
System.out.println(str);
}
in.close();
}
}
好像我的机上只要有Exception就不行是怎么回事啊
2:本人对接口和包以及异常不是很明白那位大哥能给小弟解解疑