- 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 11 times
There is an error in the code below - what is it? ArrayList mylist = new ArrayList(); for (int i = 0; i
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
There is an error in the code below - what is it? ArrayList mylist = new ArrayList(); for (int i = 0; i
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