Could you tell me how to change the problem of JAVA inheritance?

the parent class has a structural body length red box so

public class Pageable<T> implements POJO {
    private static final long serialVersionUID = -410571025796786344L;
    private int pageSize;
    private int page;
    private Collection<T> data;
    private int length;

    public Pageable() {
    }

    public Pageable(int page, int pageSize, int length, Collection<T> data) {
        this.page = page;
        this.pageSize = pageSize;
        this.length = length;
        this.data = data;
    }

what should I do if I don"t have a subclass page pagesize data? The
is still the scarlet letter after it has been changed.

public class NewPageable<T> extends Pageable<T> {
    private int total;

    public NewPageable(int page, int pageSize, int total, Collection<T> data) {
        super(page, pageSize, data);
        this.total = total;

    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

}
Jun.11,2021

it's not that the subclass does not have permission to access it. The Java specification suggests that you instantiate the parent class attribute variable by calling the constructor of the parent class. Try calling super (.)

. < hr >

update:
you change super (page, pageSize, data); to super (page, pageSize, data.size (), data); try
in addition, the subject modifies the problem later, do not delete it and update it later

Menu