i have a class that takes a user input of how many integers and then
takes in the same number of intergers. What I need to do is create
some sort of array and run throgh the input to get the smallest and
the largest etc. Here's code:
import java.util.ArrayList;
public class SelectionSort
{
public static void main( String[] args )
{
Terminal terminal = new Terminal();
int sortTotal;
sortTotal = terminal.readInt("Integers to sort: ");
int number[] = new int[sortTotal];
for (int i = 0; i < number.length; i++) {
int n = terminal.readInt("> ");
}
}
}
The output is:
Integers to sort: 3
> 2
> 4
> 6
can anybody get me started with a sort method.