|
Relates :
|
ccc write-up specifies:
"...the name of the variable may not be...redeclared as an exception parameter of a catch clause in a try statement of the directly enclosing method or initializer block"
but this code compiles without error:
public class negtest06 {
String test1( ) {
String ret = null;
try {
try ( java.io.FileInputStream str = new java.io.FileInputStream("foo.txt") ) {
ret = str.getClass().getSimpleName();
} catch( Exception str) {}
} catch ( Exception str ) {}
return ret;
}
}
|