Simple stuff but somehow not able to crack it, below piece of code gives compile time exception like unexpected token at try/catch and unhandled exception:java.io.FileNotFound
String fileName = "C:\\GS.xlsx";
try{
CSVReader reader = new CSVReader(new FileReader(fileName));
}catch(Exception e){
}
What is the possible issue in here, i know there is something really goofy that am doing in here…
Update
Issue was, I didn’t had my code in method…result of longs hrs of continous work…
public class PositionGS {
public PositionGS() {
String fileName = "C:\\GS.xlsx";
try {
CSVReader reader = new CSVReader(new FileReader(fileName));
} catch (Exception e) {
}
}
}
that’s the complete code…
You need to have this code inside a method or constructor, not sitting on its own in the class.