Exception handling is required. Create a constructor and initialize it.
...
import javax.xml.parsers.ParserConfigurationException;
public class WordDatas {
private DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
private DocumentBuilder db;
public WordDatas() {
try {
db = dbf.newDocumentBuilder();
} } catch(ParserConfigurationException e) {
// If an error occurs when initializing Dom Parser
}
}
}
I'm leaving it just in case you don't know.
First, think about what the error message means and try alt + enter in the red line.
I recommend you to work on correcting errors as below.
You can choose the appropriate method you think of from the ones you recommended.
© 2024 OneMinuteCode. All rights reserved.