我正在使用apachePOI库研究excel的读/写,我发现了两种类型的解决方案,一种是使用HSSFWorkbook实现的,另一种是使用Workbook实现的。现在我怀疑为什么有两种解决方案来实现单一功能。
我的代码:
FileInputStream fis=new FileInputStream("D:\\Extras\\SeleniumPractice\\TestData.xlsx");
Workbook workbook=WorkbookFactory.create(fis);
Sheet sheet=workbook.getSheet("TestData");
当我搜索时:
FileInputStream file = new FileInputStream(new File("C:\\test.xls"));
//Get the workbook instance for XLS file
HSSFWorkbook workbook = new HSSFWorkbook(file);
//Get first sheet from the workbook
HSSFSheet sheet = workbook.getSheetAt(0);
提前致谢.. :)
谢谢马赫什