Check out example codes for "how to read a csv file java". It will help you in understanding the concepts better.

Code Example 1

FileReader from = new FileReader("data.txt");
Scanner source = new Scanner(from);
int count = source.nextInt();
String str =;
String wholeLine = source.nextLine();

Code Example 2

BufferedReader csvReader = new BufferedReader(new FileReader(pathToCsv));
while ((row = csvReader.readLine()) != null) {
    String[] data = row.split(",");
    // do something with the data

Learn ReactJs, React Native from