Pages

Jul 5, 2015

"final" in Java

"final" doesn't guarantee immutable. It only protect the reference, not the object it references to.

ex:
private final int[] x; //x cannot change, but x[0] can change.

No comments:

Post a Comment