FileInputStream file=new FileInputStream ("C:\\Users\\sagar.lankegowda\\Desktop\\My workspace\\adt bundle\\adt-bundle-windows-x86_64-20140702\\eclipse\\Excel\\UserCreditanls.xls");
Workbook wb=WorkbookFactory.create(file);
Sheet st=wb.getSheet("Sheet1");
Row r= st.getRow(0);
Cell c=r.getCell(1);
String str="";
if(c.equals(str))
{
System.out.println(c.getStringCellValue());
}
//System.out.println(str);
else
{
System.out.println(c.getNumericCellValue());
}
System.out.println(str);
While running this code I am getting an exception as:
Exception in thread "main" java.lang.IllegalStateException: Cannot get a NUMERIC value from a STRING cell