我尝试了下面的代码,但不好,我无法创建 excel 文档,打开和关闭它。
package tests;
import java.io.*;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.util.*;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
public class Xls_Reader {
Workbook wb = new XSSFWorkbook();
FileOutputStream fileOut = new FileOutputStream("workbook.xlsx");
}
我收到以下错误:
Default constructor can not handle exception type FileNotFoundException
thrown by implicit super constructor . Must define an explicit constructor.
有人可以帮我理解使用 POI API 创建 excel 文件的概念吗?