:: Forum >>

clone

wat is the advantage of clone
jhon
Saturday, February 17, 2007
Clone => Copy all properties from objet to a new object.
Advantage? U dont need to copy properties in manually mode.
// manually
Car car1 = new Car();
car1.setColor("red");
car1.setName("bmw");
car1.setYear("2007");

Car car2 = new Car();
car2.setColor(car1.getColor());
car2.setName(car1.getName());
car2.setYear("2007");

// clone
car2 = car1.clone( );
Pc (from Brazil)
Saturday, February 17, 2007

This topic is archived.


Back to support forum

Forum search