Consider the code below:
DummyBean dum = new DummyBean(); dum.setDummy(\"foo\"); System.out.println(dum.getDummy()); // prints \'foo\' DummyBean dumtwo = du
Yes, you are just making a reference to the object. You can clone the object if it implements Cloneable.
Cloneable
Check out this wiki article about copying objects.
Refer here: Object copying