Campbell Ritchie wrote:Note that simple use of the = operator is acceptable if the variable is a primitive or an immutable type; if it is a mutable reference type it should be copied before you let it into your object and copied before you let it out of your object. This is a sample section from the old edition of Joshua Bloch's Effective Jaca™ about copying fields.
Lots of people don't realise that for a very long time. And … “that's a pleasure ”Aline Galea wrote:. . . I never really thought about what using reference variables meant for encapsulation. Thanks for that too.
In that situation, this. is redundant.Stephan van Hulst wrote:. . . . use the 'this' keyword is inside a method that takes as its argument another object of the same type. In those cases 'this' is used to explicitly show whether the current object or the external object is being acted upon. . . . .
Redundant as inJunilu Lacar wrote:. . . . redundant . . . .
That means they have duplicated the brake circuits so if one circuit is damaged, for example by driving over an obstruction, the car will still stop. As I said, it doesn't mean unnecessary.The newest series of cars from XYZ Motors have redundant brake circuits on all four wheels.