import java.io.*; import jxl.*; class Xlparsing { Workbook wb =wb.getWorkbook(new File( "C:\Documents and Settings\kmoorthi\Desktop\ak\new.xls")); // Illegal forward reference What it means Sheet st = wb.getSheet(0); Cell cell1 = st.getCell(0,0); String a1 = cell1.getContents(); public static void main(String s[]) { System.out.println(new Xlparsing().a1); } }
Hi When I tried to extract data from excel sheet illegal forward reference error comes in the file object creation.
How to resolve this?
"Illegal forward reference" means that you are trying to use a variable before it is defined.
In this case, you are trying to invoke a method on wb in the declaration of wb.
wb
Workbook wb = wb.getWorkbook(...);
2.1m questions
2.1m answers
60 comments
57.0k users