我已经建立了我自己的异常,但是当我尝试使用它,我收到一条消息说,它不能转换到我的例外问题处理异常
我有一个接口,这样
public interface MyInterface
{
public OtherClass generate(ClassTwo two, ClassThree three) throws RetryException;
}
其它类似的在另一类这种一个
public class MyGenerator{
public class generate (ClassTwo two, ClassThree three){
try{
}catch(MyException my)
}
}
和最后一个方法
public Object evaluate(String expression, Map values) throws FirstException, RetryException
{
try{
}catch (Exception x){
if(x instanceof FirstException){
throw new FirstException()
}
else{
RetryException retry= (RetryException)x;
retry.expression = expression;
retry.position = position;
retry.operator = tokens[position];
retry.operand = 1;
throw retry;
}
}
}
上的最后一个方法此try catch块是要对数学进行操作,我想通过在RetryException
零异常赶上一个部门。
说whaaaaaaaa O_O – mre
我固定的代码标签,然后有人在我身后编辑弄乱了.... –
大干一场来解决这一职务。 – James