APAPA - Avoid Public And Package Attributes

Declare the attributes either private or protected and provide operations to access or change them.

There might be one exception when some class is used just as struct in C language: it just holds some values, and thus has no methods. Formally option regulates whether to raise violations for such classes. When formally option is off, violations are not raised.

Wrong

class APAPA {
    int attr1;
    public int attr2;
}

Tip: Change visibility of attributes to either private or protected.
Provide access operations for these attributes.

Right

class APAPA {
    private int attr1;
    protected int attr2;
    public int getAttr1() {
        return attr1;
    }
    public int getAttr2() {
        return attr2;
    }
    public void setAttr2(int newVal) {
        attr2 = newVal;
    }
}