Page 1 of 1

There is an error in the code below - what is it? ArrayList mylist = new ArrayList(); for (int i = 0; i

Posted: Tue Jul 05, 2022 10:25 am
by answerhappygod
There Is An Error In The Code Below What Is It Arraylist String Mylist New Arraylist String For Int I 0 I 1
There Is An Error In The Code Below What Is It Arraylist String Mylist New Arraylist String For Int I 0 I 1 (59.7 KiB) Viewed 13 times
There is an error in the code below - what is it? ArrayList<String> mylist = new ArrayList<String>(); for (int i = 0; i < mylist.size(); i++) System.out.print(mylist); Select one OA. The array list is empty, the loop will cause an out-of-range error OB. Array list doesn't have a size() method. It uses the length property instead OC Array list doesn't use the [] operator D. Array lists cannot contain String objects