import java.util.Date;
public final class Schedule {
private final Date start;
private final Date end;
public Schedule(Date start, Date end) {
if (start.compareTo(end) > 0)
throw new IllegalArgumentException(start + " after " + end);
this.start = start;
this.end = end;
}
public Date getStart() {
return start;
}
public Date getEnd() {
return end;
}
}
类中有有参构造,应该手动添加无参构造,可添加后报错,不添加反而正常,求大神解释下为什么?