Java Langauge
Accept a positive integer n from keyboard and then create an arrayor arraylist containing n random elements within the range [−n,n].Print out the random array or arraylist,
Answer
import java.util.ArrayList;import java.util.Random;import java.util.Scanner;public class RandomList { public static void main(String[] args) { Scanner in = new Scanner(System.in); System.out.print(“Enter a positive integer for n: “); int n = in.nextInt(); ArrayList<Integer> list = new ArrayList<>();
OR
OR