Creating list

Report a typo

Create an ArrayList named list in any way known to you and fill it with the following four numbers: 2, 0, 1, 7.

The code for displaying the list is already written.

Sample Input 1:

Sample Output 1:

[2, 0, 1, 7]
Write a program in Java 17
import java.util.*;

public class Main {

public static void main(String[] args) {


//write your code here


System.out.println(list);
}
}
___

Create a free account to access the full topic