how to sort an array of numbers in java code example
Example: how to sort integer array in java
int countOfArray = 5;
int num [] = new int[counfOfArray];
int num[] = [8 , 5 , 9 , 3 , 4];
for (int i = 0; i < countOfArray; i++)
{
for (int j = i + 1; j < countOfArray; j++) {
if (num[i] > num[j])
{
temp = num[i];
num[i] = num[j];
num[j] = temp;
}
}
}