Copying Arrays
One way is to use the clone method which (by default) just does a shallow copy (so it's fine only for primitive one-dimensional arrays).
Another way is to use System.arraycopy(src, 0, dest, 0, length).
Arrays.copyOf(src, nitems) will copy nitems, filling in nulls where appropriate, and copyOfRange(src, a, b) will copy src from a to b. copyOf and copyOfRange are meant to be more efficient than System.arrayCopy.
Array Utils
java.util.Arrays - contains various methods for manipulating arrays (sorting and searching). Arrays has been around since Java2, and is part of the JCF.
Arrays.binarySearch( array, key ). Can be float array, double array, int array.
Arrays.fill(array, value)
Arrays.asList returns the array presented as a java.util.List.
Ubu World Cafe - Linux Variant CentOs
-
The UbuWarrior has in its awareness a knowledge of other Linux variants.
Today, we talk about the mysterious CentOS. CentOS is derived from RHEL
(Red Ha...
9 months ago
No comments:
Post a Comment