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
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