I have a problem using a variable surrounded with a try : Here's the beginning of my method :
public static word[] countWords(String text) {
try {
text = Preprocesseur.preprocess(text);
}
catch (IOException e) {
System.out.println("Error méthod countWords");
e.printStackTrace();
}
Actually i need to use the String text (preprocessed) several line after, but java doesn't affect the value Preprocesseur.preprocess(text) to the whole method --> it stays in the try/catch block
I was wondering : how to call my method Preprocesseur.preprocess and affect its return String to the whole countWords method ? Because a try/catch block is required (or throws declaration which leads to the same result)