我想使用没有标题标题的 poi 读取 excel 文件,我的预期结果是

这是我的代码
public String processExcel(Model model, @RequestParam(value = "excelfile", required = false) MultipartFile excelfile, HttpSession session) {
try {
List<UserRegistrationDetail> lstUser = new ArrayList<>();
Workbook workbook = null;
if (excelfile.getOriginalFilename().endsWith("xlsx")) {
workbook = new XSSFWorkbook(excelfile.getInputStream());
} else if (excelfile.getOriginalFilename().endsWith("xls")) {
workbook = new HSSFWorkbook(excelfile.getInputStream());
} else {
model.addAttribute("msg", new IllegalArgumentException("The specified file is not Excel file"));
}
Sheet worksheet = workbook.getSheetAt(0);
Iterator<Row> iterator = worksheet.iterator();
while (iterator.hasNext()) {
Row nextRow = iterator.next();
Iterator<Cell> cellIterator = nextRow.cellIterator(); …Run Code Online (Sandbox Code Playgroud) 我有像这样的变量int数组
int[] sample = new int[];
sample[0] = 1;
sample[1] = 2;
String two = sample[1].toString(); <==== i have problem with this
System.out.println(two);
Run Code Online (Sandbox Code Playgroud)
如何解决它们?我不能将int [1]的值显示为字符串..