用immutable object造句子,“immutable object”造句

來源:國語幫 1.91W
immutable object造句

If you have an immutable object, you must set whatever state it will contain in the constructor.

If you want to change an immutable object, you don't - you create a new object with the changed value and point your reference to it.

An immutable object's state cannot change after construction. In other words, the constructor is the only way you can mutate the object's state.

So as long as you stick to the simplest rules of concurrent programming - stateless services and immutable objects, it will be a breeze to wire your services to any producer or consumer.

熱門標籤