76.0k views
0 votes
You have an int array named examScores that is 1000 elements in length. Provide a single line of code that would sort the examScores. (Note: You do not need to provide the import statements supporting the line of code)

User Kevin Dahl
by
5.4k points

1 Answer

5 votes

Answer:

Arrays.sort(examScores);

Step-by-step explanation:

The line of code above will sor the array using the sort method from the java.util.Arrays.

The complete java code showing the importation of the class as well as creating the array examScores[] with 1000 elements is shown below:

import java.util.Arrays;

public class num5 {

public static void main(String[] args) {

int [] examScores = new int[1000];

Arrays.sort(examScores);

}

}

User Byron Sommardahl
by
5.3k points