Here you can find the source of sortPopup(Integer[] integers)
Parameter | Description |
---|---|
integers | a parameter |
public static Integer[] sortPopup(Integer[] integers)
//package com.java2s; //License from project: Apache License public class Main { /**/*from w w w .ja va2 s .c om*/ * popup sorting (assent) * @param integers * @return */ public static Integer[] sortPopup(Integer[] integers) { Integer[] sortedIntegers = new Integer[integers.length]; System.arraycopy(integers, 0, sortedIntegers, 0, integers.length); int arrayLength = sortedIntegers.length; for (int i = 0; i < arrayLength - 1; i++) { int a = sortedIntegers[i]; for (int j = i + 1; j < arrayLength; j++) { int b = sortedIntegers[j]; if (a > b) { sortedIntegers[i] = b; sortedIntegers[j] = a; a = b; } } } return sortedIntegers; } }