Complete the code to open the CSV file for reading.
BufferedReader reader = new BufferedReader(new FileReader([1]));The file path must be a string literal, so it needs to be in quotes.
Complete the code to read one line from the CSV file.
String line = reader.[1]();The correct method to read a line from BufferedReader is readLine() with capital L.
Fix the error in splitting the CSV line into values.
String[] values = line.[1](",");
The split method splits a string by a delimiter and returns an array.
Fill both blanks to loop through CSV lines and print the first value.
while (([1] = reader.readLine()) != null) { String[] values = [2].split(","); System.out.println(values[0]); }
The variable line stores each line read and is used to split into values.
Fill all three blanks to close the reader and handle exceptions.
try { BufferedReader reader = new BufferedReader(new FileReader("data.csv")); String [1]; while (([2] = reader.readLine()) != null) { String[] values = [3].split(","); } reader.close(); } catch (IOException e) { e.printStackTrace(); }
The variable line is declared and used consistently to read and split lines.
