public class InsertionSort {
|
Showing posts with label immutable. Show all posts
Showing posts with label immutable. Show all posts
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:
-->
Labels:
bubble sort,
final modifier,
immutable,
insertion sort,
java
Subscribe to:
Posts (Atom)