PMD代码检查:在子类的构造函数中调用super()(CallSuperInConstructor)

https://docs.pmd-code.org/pmd-doc-6.55.0/pmd_rules_java_codestyle.html#callsuperinconstructor

在子类的构造函数中调用super()是一个好的实践。例如:

package com.thb;

/**
 * 子类.
 * @author thb
 *
 */
public class Child extends Parent {

    private String name;

    public Child() {
        super();
    }

    public Child(String name) {
        this();
        this.name = name;
    }

}

你可能感兴趣的:(java,PMD)