Array sorting

Report a typo

Use the Arrays.sort() method to sort the given array and print it.

Sample Input 1:

13 8 5

Sample Output 1:

[5, 8, 13]
Write a program in Java 17
import java.util.Scanner;
import java.util.Arrays;

public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int[] arr = {scanner.nextInt(), scanner.nextInt(), scanner.nextInt()};
// write your code here

System.out.println(/* Print the sorted array here */);
}
}
___

Create a free account to access the full topic