Here is a small code segment that i have extracted from a program to read MS excel file using POI api. I am getting following error messages in NetBeans at the lines i have colored corresponding to the code lines
2. incompatible types
Found : java.util.Iterator<org.apache.poi.ss.usermodel.Cell>
Required : java.util.Iterator<org.apache.poi.[b]hssf.usermodel.HSSFCell>
[/b]what could be the reason?
Use the API properly. HSSFSheet.iterator() returns an Iterator<Row>, not an Iterator<HSSFRow>, and Row.cellIterator() returns an Iterator<Cell>, not an Iterator<HSSFCell>. I think this will solve both your problems.