Convert the array to a List

Report a typo

Convert the array to a List and print the first element.

Sample Input 1:

8 11 20

Sample Output 1:

8
Write a program in Java 17
import java.util.Scanner;
import java.util.Arrays;
import java.util.List;

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

System.out.println(/* Print the first element here */);
}
}
___

Create a free account to access the full topic