[Solved] How to get value from void method? [closed]


You might set your Matrix properties based on the Dimension like

class Matrix implements MatrixInterface {
    private Integer width;
    private Integer height;

    void GetSize(Dimension dim) {
        this.width = dim.width;
        this.height = dim.height;
    }
}
// Please note that this code isn't clean.

Or maybe the Getter is in fact a Setter.

class Matrix implements MatrixInterface {
    private Dimension dimension;

    void GetSize(Dimension dim) {
        this.dimension = dim;
    }
}
// Please note that this code isn't clean.

5

solved How to get value from void method? [closed]