我试图返回一个 userData 的 ArrayList,它是数据库中所有用户的用户名。我一直在尝试返回 ArrayList 时遇到错误。任何人都可以帮忙吗?
import java.util.*;
import java.io.*;
import java.util.ArrayList;
public class readCSV
{
List<String[]> userData = new ArrayList<String[]> ();
public void checkLogin() throws IOException
{
try
{
File file = new File("C:/Users/Sean/Documents/Programming assigment/Users.csv");
BufferedReader bufRdr = new BufferedReader(new FileReader(file));
String lineRead = bufRdr.readLine();
while(lineRead != null)
{
ArrayList<String> list = new ArrayList<String>();
while(lineRead != null)
{
this.userData.add (lineRead.split(","));
}
bufRdr.close();
}
}
catch(Exception er){
System.out.print(er);
System.exit(0);
}
}
public String[] getLogin()
{
return userData;
}
}
错误不兼容类型