public class InsertionSort {
|
Tuesday, September 18, 2012
Final != Immutable
Just learned that in Java 1.6 (or anything after 1.3, from what I recall from the blog that I read), the final modifier on a primitive int array does not imply immutability (non-modifiable); found this when playing with a couple of sorting algorithms. In the code below, if we want to use the same static array 'array' to be printed before sending it to various successive sorting methods, then we should send clones of it:
-->
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment