Page 1 of 1

About Question enthuware.ocpjp.v7.2.1255 :

Posted: Mon Feb 02, 2015 1:27 pm
by ewebxml
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:

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         
    }     
  }     
}

Re: About Question enthuware.ocpjp.v7.2.1255 :

Posted: Mon Feb 02, 2015 10:26 pm
by admin
Fixed.
thank you for your feedback!