Convert the array to a List and print the first element.
java.util.Arrays
Convert the array to a List
Report a typo
Sample Input 1:
8 11 20Sample Output 1:
8Write 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 */);
}
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.