Try to initialize a Dimensional Array Index : <p>Hello i tried to compile my Code but this error Code appears:
Bughunt04.Java:28: error: variable index might not have been initialized  a[index] = index;</p>

<p>This is my Code </p>

<pre><code>if (args.length != 2){
        System.out.println("ERROR");
        return;
    }

    System.out.println("Eindimensionaler Fall");
    int z = Integer.parseInt(args[0]);

    int a[] = new int[z];
    // Initialisieren des Arrays (die genauen Werte sind nicht wichtig)
    int index;
    for (z = 0; z &lt; z; z++){
        a[index] = index;
    }

    index = 1;
    while (index &lt; z/2){
        // swap tauscht in a die Elemente an den beiden uebergebenen Stellen
        a = swap(a, index, z-index);
        index++;
    } 
</code></pre>
