Demo entry 5864518



Submitted by anonymous on Aug 14, 2016 at 15:19
Language: Java. Code size: 460 Bytes.

package creating.objects;

 * @author elmaghra
public class ObjectWithStaticFactoryMethods {
    private int attr1;
    private boolean attr2;

    private ObjectWithStaticFactoryMethods(int attr1, boolean attr2) {
        this.attr1 = attr1;
        this.attr2 = attr2;

    public static ObjectWithStaticFactoryMethods valueOf(int attr1, boolean attr2){
        return new ObjectWithStaticFactoryMethods(attr1,attr2);

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).