Array index out of bounds Error
<p>I've been having some trouble with this code I made up, in that I've been getting an <code>ArrayIndexOutofBounds</code> exception error and I have no idea what is going on. What I want my code to produce is a char array of numbers.</p>

<p>Here's the code: </p>

<pre><code>public class testing {

    static int k = 2;

    public static void main(String args[]) {

        int[] numArr = new int[] { 15, 18, 21 };

        createChar(numArr, k);
    }

    public static char[] createChar(int numArr[], int k) {
        char[] store = new char[k - 1];

        for (int i = 0; i &lt; k; i++) {
            int divide = numArr[i] / 4;

            int numStore = divide % 4;
            charN(numStore, store, k);
        }
        return store;
    }

    public static char[] charN(int numStore, char store[], int k) {
        for (int i = 0; i &lt; k; i++) {
            if (k == 0) {
            } else {
                store[k - 1] = (char) numStore;
                k = k - 1;
            }
        }
        System.out.print(store);
        return store;
    }
}
</code></pre>

<p>Thanks a lot!</p>
