public static List> readCSVFile() { List data = new ArrayList>(); try { Reader in = new FileReader("commons-csv-1.8.jar"); Iterable records = CSVFormat.DEFAULT.parse(in); %3D for (CSVRecord record :...


How would I add the following data (country and data) into an ArrayList? I keep getting an ArrayIndexOutOfBoundsException


public static List<List<Country>> readCSVFile() {<br>List data = new ArrayList<List<Country>>();<br>try {<br>Reader in = new FileReader(
records = CSVFormat.DEFAULT.parse(in); %3D for (CSVRecord record : records) { String country = record.get(0); String continent = record.get(1); } } catch (IOException e) { System.out.println(e); } return data; } "/>
Extracted text: public static List<>> readCSVFile() { List data = new ArrayList<>>(); try { Reader in = new FileReader("commons-csv-1.8.jar"); Iterable records = CSVFormat.DEFAULT.parse(in); %3D for (CSVRecord record : records) { String country = record.get(0); String continent = record.get(1); } } catch (IOException e) { System.out.println(e); } return data; }

Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here