Using "throw FileNotFoundException" or "try-catch block"-stil doesnt work
807600Nov 14 2007 — edited Nov 14 2007Hello,
at one place of my program I load some data from a file....in another class called MSA_Solution I get from my IDE "unreported exception java.io.FNFE, must be caught or declared to be thrown" statement. Its on the row marked "HERE: in the code below...
{code}import java.io.FileNotFoundException;
public class MSA_Solution extends Solution {
HERE -> private MSA_One alignment_1 = MSA_One.getInstance();
private double objectiveSumOfPairs;
private double objectiveAffineGaps;{code}
If I do this:
{code}public class MSA_Solution extends Solution throws FileNotFoundException ...{code}
the warning statement is still there
or if I surround the code with try/cath block even more warning statements appears(illegal start of type, unreported FNFE exception, <identifier> expected)...I guess I cannot use try-catch block for field declarations?
can anybody please help me? how can I correct the code to get rid of the unreported FNFE statement? Thanks a lot