Here you can find the source of bubbleSortArray(String[] str)
public static String[] bubbleSortArray(String[] str)
//package com.java2s; public class Main { public static String[] bubbleSortArray(String[] str) { String temp = null;/*from w ww . j a v a2 s. c om*/ for (int i = str.length - 1; i > 0; --i) { for (int j = 0; j < i; ++j) { if (str[j + 1].length() < str[j].length()) { temp = str[j]; str[j] = str[j + 1]; str[j + 1] = temp; } } } return str; } }