About Question enthuware.ocpjp.v7.2.1255 :
Posted: Mon Feb 02, 2015 1:27 pm
The method contains 1 too many end braces: (that is, unmatching braces)
The code currently contains 3 ending braces.
I understand that the third ending brace represents the ending brace for the containing class.
Should be:
-----
OR
The code currently contains 3 ending braces.
I understand that the third ending brace represents the ending brace for the containing class.
Should be:
Code: Select all
public void readData(String fileName) throws Exception {
try(FileReader fr1 = new FileReader(fileName)){
Connection c = getConnection();
//...other valid code
}
}
OR
Code: Select all
public class TestClass{
public void readData(String fileName) throws Exception {
try(FileReader fr1 = new FileReader(fileName)){
Connection c = getConnection();
//...other valid code
}
}
}