【发布时间】:2016-09-22 12:15:41
【问题描述】:
使用这个类:
public class Fallible<T> {
private final Exception exception;
private final T value;
public Fallible(final T value) {
this.value = value;
this.exception = null;
}
public Fallible(final Exception exception) {
this.value = null;
this.exception = exception;
}
}
我可以安全地假设value 将从不包含异常对象吗?
【问题讨论】: