如果我有以下代码:尝试捕捉在Java
try {
Entity questionEntity = datastore.get(currentKey);
questionEntity.doSomething();
} catch (EntityNotFoundException e) {
Entity questionEntity = new Entity(currentKey);
}
凡datastore.get()
函数抛出一个异常,将在try块代码(questionEntity.doSomething();
)以下行来执行?
那(questionEntity.doSomething())线当且仅当执行上一行没有导致异常被抛出。 –