Sorting the absolute values

Report a typo

Write code that returns an array of sorted integer absolute numbers of the given array. The elements should be sorted in ascending order.

Try not to use the for loop, but use Stream API.

Sample Input 1:

1 2 6 -3 -9

Sample Output 1:

1 2 3 6 9
Write a program in Java 17
import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.Collectors;

public class Main {

/**
* Returns the sorted array of absolute numbers in ascending order.
*
* @param numbers the input array of String integer numbers
* @return the sorted array of integer absolute numbers
*/
public static int[] sortedAbsNumbers(String[] numbers) {
// write your code here
}

// Don't change the code below
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println(Arrays.stream(sortedAbsNumbers(scanner.nextLine().split("\\s+")))
.mapToObj(String::valueOf)
.collect(Collectors.joining(" "))
);
}
}
___

Create a free account to access the full topic