Java BubbleSort
<p>I am facing a problem where I need to sort a String array in alphabetical order. I am able to sort one array, but the problem starts when there are 2 more arrays, that correspond to the first array. Each value in each array should be in the same place, to make information not messed up. After sorting <code>array1</code>, it is in alphabetical order, but i don't have any idea how to make values from <code>array2</code> and <code>array3</code> change the positions the same like in <code>array1</code> after sorting is finished.</p>

<p>My code so far is:</p>

<pre><code>public  void sort() 
{

    boolean finish = false;

    while(finish == false){

        finish = true;

        for(int i=0;i&lt;Country.length-1;i++)

        {
            int num = 0;
            if(Country[i] != null &amp;&amp; Country[i + 1] != null)
            {
                String name1=Country[i]; String name2=Country[i+1];
                num=name1.compareTo(name2);
            }
            else if(Country[i] == null &amp;&amp; Country[i + 1] == null){
                num = 0;
            }
            else if(Country[i] == null){
                num = 1;
            }
            else {
                num = -1;
            }
            if(num&gt;0)
            {
                String temp=Country[i];

                Country[i]=Country[i+1];
                Country[i+1]=temp;
                finish=false;
            }
        }
    }
</code></pre>