It is required to read xls file. But try is never executed, and the condition from catch is satisfied. As a result, bb = {β0,0,0,0β}. I can not understand what I'm doing wrong. The file is in the project folder.
Moving the file to another location, changing the name did not give anything. I thought the thing was that it was xls, but even with txt it was the same.
Book bb = new Book(); String[] mas = bb.boob(); public class Book { public String[] data = new String[4]; public String[] boob() { try(FileInputStream fis = new FileInputStream("list.xls")) { //Workbook wb = new HSSFWorkbook(fis); for(int i=0; i<4; i++){ data[i] = "1"; } fis.close(); return data; } catch (IOException e){ String[] d ={"0","0","0","0"}; return d;} } }
System.out.println(new File("list.xls" ).getCanonicalPath()). Miracles do not happen - if the file is not located, then it is not there. - Pavel Mayorov