PRINTING OUT A JAVA ARRAY WITH JAVA.UTIL.ARRAYS What do you do if you print an array out to a log or debug line, but the Java array Object's toString() method is useless. Use the java.util.Arrays class instead. The following code outputs something like: [Ljava.lang.Object;@14af67 Object[] objs = new Object[] {"abby", "bob", "chris"}; System.out.println( objs ); Instead do: import java.util.Arrays; .... Object[] objs = new Object[] {"abby", "bob", "chris"}; System.out.println( Arrays.asList(objs) ); This uses the java.util.List's better toString: [abby, bob, chris] Note that the asList method returns an immutable List, so entries are not allowed to be changed. The Arrays class contains other useful methods. It can tell you if a pair of arrays are equal, which means they contain equal values, via its static equals(Object[], Object[]) method. The method is overridden numerous times to account for arrays of the Java primitives, int, char etc. You can do a search on an array using the binary search algorithm. As before, there are overridden versions for each Java primitive as well as an extra method that takes a Comparator. There is also a fill method that allows you to set all the array values to a single value, optionally specifying a start and end index if only a slice of the array is wished to be a default value. For example: // initialise all 55 elements int[] percentages = new int[] { 100, 100, 100, 100, ... 100 }; can be more easily written as: import java.util.Arrays; .... int[] percentages = new int[55]; Arrays.fill( percentages, 100 ); Finally you can sort an array or a slice of an array, providing an optional Comparator for Object arrays. The sorting algorithm is stable so Objects that are 'equal' will not get jumbled around. The java.util.Arrays class is a powerful provider of standard functionality, which often gets overlooked in favor of its sibling, java.util.Collections. Also of note is the java.lang.System.arraycopy method. It provides a high-performance way to copy values from one array to another. REFERENCES: JAVA.UTIL.ARRAYS JAVADOC http://java.sun.com/j2se/1.3/docs/api/java/util/Arrays.html JAVA.LANG.SYSTEM#ARRAYCOPY JAVADOC http://java.sun.com/j2se/1.3/docs/api/java/lang/System.html#arraycopy(java.lang.Object,int, java.la --------------------------------------------