Question: ```
    public boolean used[] = new boolean[26];

```

Here is what I have, and it's working great. I know they are all going to be set as false by default. But, as my application is used for a while, some of those are changed to "true". (Which is fine, since that's what my code is supposed to do). 

I'm trying to create a "reset" button, which will simulate a reset-like action. Where all variables are restored to what they were when the window was initially created (all drawings go away - just a fresh restart).

And I need all of those true booleans to go back to false in one fell swoop. Any ideas?

Answer: 
*Arrays.fill* uses a *rangecheck* before filling your array. 

```
public static void fill(Object[] a, int fromIndex, int toIndex, Object val) {
        rangeCheck(a.length, fromIndex, toIndex);
        for (int i=fromIndex; i<toIndex; i++)
            a[i] = val;
    }

/**
     * Check that fromIndex and toIndex are in range, and throw an
     * appropriate exception if they aren't.
     */
    private static void rangeCheck(int arrayLen, int fromIndex, int toIndex) {
        if (fromIndex > toIndex)
            throw new IllegalArgumentException("fromIndex(" + fromIndex +
                       ") > toIndex(" + toIndex+")");
        if (fromIndex < 0)
            throw new ArrayIndexOutOfBoundsException(fromIndex);
        if (toIndex > arrayLen)
            throw new ArrayIndexOutOfBoundsException(toIndex);
    }

```

if you don't need rangeCheck, you can just use a *forloop* to fill up your boolean array.

```
for(int i = 0; i < used.length; ++i){
    used[i] = false;
}

```
Use `java.util.Arrays.fill()`:

```
Arrays.fill(used, false);

```