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
ERROR ENCOUNTERED:
1. incompatible types
Found : org.apache.poi.hssf.usermodel.HSSFSheet.Iterator
Required : java.util.Iterator<org.apache.poi.hssf.usermodel.HSSFRow>
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]
[code]//instantiate POIFSFileSystem encapsulating inputstream
fileSystem = new POIFSFileSystem(inputStream);
//create a
java usable(High level) worksheet from the POIFSFileSystem
HSSFWorkbook workBook = new HSSFWorkbook(fileSystem);
//obtain worksheet from high level WorkBook object
HSSFSheet sheet = workBook.getSheetAt(0);
//Create Iterator object to get Rows
Iterator<HSSFRow> rows = sheet.Iterator();
//Iterate to get Rows
while (rows.hasNext ())
{
//Get High Level Row Object
HSSFRow row = rows.next ();
//Display row number in the console.
System.out.println ("Row No.: " + row.getRowNum ());
//Create Iterator to get Cells
Iterator<HSSFCell> cells = row.cellIterator();
what could be the reason?