Skip to main content

How can I reduce boilerplate code

(How) can I reduce the boilerplate code below.

package com.javahowdoi.challengeq;

public class BoilerPlateQ {
    private int i;
    private String s;

    public BoilerPlateQ(int i, String s) {
        this.i = i;
        this.s = s;
    }

    public int getI() {
        return i;
    }

    public void setI(int i) {
        this.i = i;
    }

    public String getS() {
        return s;
    }

    public void setS(String s) {
        this.s = s;
    }
}

Here's an answer

Comments