用idea编写java,出现这种情况
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
at yecheng.Search.main(Search.java:18)
Process finished with exit code 1
源代码:
public class Search {
public static void main(String[] arg){
MysqlDB db = new MysqlDB();
Index index = new Index();
ReadFile rf = new ReadFile();
File file = new File(arg[0]);
try {
rf.readFile(file);
index.loadDB(db);
int id = index.search(rf.fingerprint,15);
System.out.println(id);
} catch (Exception e) {
e.printStackTrace();
System.out.println(e.toString());
}
}
}