Page 1 of 1

What will be in the ArrayList nums after the following code is run? ArrayList nums = new ArrayList<>(); for (in

Posted: Sun Jul 10, 2022 11:29 am
by answerhappygod
What Will Be In The Arraylist Nums After The Following Code Is Run Arraylist Integer Nums New Arraylist For In 1
What Will Be In The Arraylist Nums After The Following Code Is Run Arraylist Integer Nums New Arraylist For In 1 (40.41 KiB) Viewed 48 times
What will be in the ArrayList nums after the following code is run? ArrayList<Integer> nums = new ArrayList<>(); for (int i = 0; i<10; i++) { if (i % 2 == 1 || i % 3 == 1) { nums.add(i); } O O } [1, 3, 5, 7, 9] [1, 3, 4, 5, 7, 9] [1, 7] [7] O [1, 5, 7]