public void run() throws LanPingException, MaoYanException
{
if(state==2)
throw new LanPingException("蓝屏了!");
if(state==3)
throw new MaoYanException("冒烟了!");
System.out.println("电脑运行");
}
public void reset()
{
System.out.println("电脑重启!");
}
}
//-------------------------------------
class Teacher
{
private String name;
private Computer cmpt;
public void test()
{
System.out.println("练习!");
}
}
//-------------------------------------------
class ExceptionTest
{
public static void main(String[] args)
{
Teacher t = new Teacher("毕老师");