I created an arraylist in Java called rows. Now I have a text file which contains information regarding a program (for example: DRAMA-Film A-2.5hours-hi) which is put into a string called strLine. strLine is then split and put into the arraylist rows.
Can anyone tell me why nothing is being output with the system.out.println statement?
import java.io.*;
import java.util.*;
class Processing
{
public static void main(String args[])
{
try{
FileInputStream fstream = new FileInputStream("file.txt");
DataInputStream in = new DataInputStream(fstream);
BufferedReader br = new BufferedReader(new InputStreamReader(in));
String strLine = null;
List<String[]> rows = new ArrayList<String[]>();
while ((strLine = br.readLine()) != null) {
String[] row = strLine.split("-");
rows.add(row);
}
System.out.println(rows.toString());
in.close();
}catch (Exception e){
System.err.println("Error: " + e.getMessage());
}
}
}
[[Ljava.lang.String;@1b0bf9a, [Ljava.lang.String;@f32dde]