我想阅读excel表中的注释。当我读取单元格值但下面的代码没有输出添加到同一单元格的注释时,下面的代码工作正常。
代码有什么问题?
public static void main(String[] args) throws IOException
{FileInputStream f = new FileInputStream("C:\\Users\\421384\\Desktop\\excel.xlsx");
XSSFWorkbook wb=new XSSFWorkbook(f);
XSSFSheet sh = wb.getSheet("sheet1");
XSSFRow r = sh.getRow(0);
XSSFCell c = r.getCell(0);
CellType type =c.getCellTypeEnum();
System.out.println(c.getStringCellValue());
XSSFComment comment = c.getCellComment();
System.out.println(comment);
System.out.println(comment.toString());
控制台输出:
akash
org.apache.poi.xssf.usermodel.XSSFComment@0
org.apache.poi.xssf.usermodel.XSSFComment@0