-2

I have a CSV file that has following form.

I read the CSV using CSV reader. It outputs the objects in following form instead of the string.

Output

[Ljava.lang.String;@138617da

**

This is my code. What is wrong with code?

   public  void readFeatures () throws IOException{
            File(classLoader.getResource(filename).getFile());

    CSVReader reader = new CSVReader(new FileReader(file));
    List myEntries = reader.readAll();

    for( int i = 0; i< myEntries.size(); i ++){
        System.out.println(myEntries.get(i).toString());
    }

}
Kumaresp
  • 35
  • 1
  • 12

1 Answers1

1

remember that you are reading an array or arrays of Strings.

The output is showing that you are trying to print an Array [L of Strings

Either create an inner loop, or try using Arrays.toString (myEntries.get(i))

Scary Wombat
  • 44,617
  • 6
  • 35
  • 64