找出构造函数层次里的 bug

来自 面向对象编程
Java 25 LTS 进阶 4分钟 找出 1处问题

找出这个继承层次中的构造缺陷。

Java
public class Main {
    static class Report {
        Report() {
            System.out.println(title());
        }

        String title() { return "report"; }
    }

    static final class MonthlyReport extends Report {
        private String month = "September";

        @Override
        String title() { return month.toUpperCase(); }
    }

    public static void main(String[] args) {
        new MonthlyReport();
    }
}
在试验场中打开
报告错误