Convert the array to a stream

Report a typo

Convert the array to a stream and print the sum of elements.

Sample Input 1:

8 11 6

Sample Output 1:

25
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 sum of elements here */);
}
}
___

Create a free account to access the full topic