import java.io.*;
class MyException extends Exception
{
MyException()
{
super();
}
MyException(String s)
{
super(s);
System.out.println("the Exception with ABCD");
}
}public class exception2
{
public static void main(String args[])throws IOException
{
while(true)
{
try
{
fn();
}
catch(RuntimeException e)
{
try
{
throw e.getCause();//这个方法不对么
}
catch(IOException s)
{
System.out.println("please again");
}
catch(MyException m)
{
break;
}

}
}
}
static void fn() 
{
try
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.println("putout u String");
String temp=br.readLine();
if(temp.equals("ABCD")==false)
{
throw new IOException();
}
else if(temp.equals("ABCD")==true)
{
throw new MyException("ABCD");
}
}catch(Exception e)//我已把他包装成runtime的异常了啊 
{
throw new RuntimeException(e);
}

}
}怎么解决判断异常类型啊
谢谢大家了