All pastes #623205 Raw Edit

Stuff

public text v1 · immutable
·published 2007-07-17 12:47 UTC
rendered paste body
    import java.awt.Dimension;

    public class Example implements Cloneable
    {
        private Dimension dim;



        public void setDimension (Dimension dim)
        {
            this.dim = dim;
        }

        public Object clone () throws CloneNotSupportedException
        {
            Example newObject = (Example)super.clone();

            if (this.dim != null)
                newObject.dim = (Dimension)this.dim.clone();

            return newObject;
        }
    }