Determine sort ordering for a bubble sort - Java Quiz Question


Write a program to sort the given string array by the bubble sort with the help of compareTo method, irrespective of case sensitivity.

Input (String[]) Output (String[])
{'Hello', 'to', 'java', 'world'} {'Hello', 'java', 'to', 'world'}
{'an', 'indian', 'am', 'I'} {'am', 'an', 'I', 'indian'}
{'good', 'I', 'am', 'girl'} {'am', 'girl', 'good', 'I'}
{'Sun', 'raises', 'east', 'in', 'the'} {'east', 'in', 'raises', 'Sun', 'the'}
{'Computer', 'mouse', 'keyboard', 'laptop'} {'Computer', 'keyboard', 'laptop', 'mouse'}



class ComparingStringsWithCompareToIgnoreCase
{
    public static void main(String s[])
    {
        String stringArray[] = {"Hello", "to", "java", "world"};
        String[] sortingStringArray = getSortingStringArray(stringArray);
        for (String str : sortingStringArray)
        System.out.print(str + " ");

    }


    public static String[] getSortingStringArray(String[] stringArray) {
    }

}