Name: igT44549 Date: 02/09/99
import java.io.*;
class C1 {
void f() throws IOException {
Object o = new Object() {
{
x.readByte();
}
};
}
DataInput x;
}
won't compile under JDK 1.2 as it objects to the exception thrown by
x.readByte().
The JDK 1.1 spec I have says:
"An instance initializer in an anonymous class can throw any exceptions."
(Review ID: 48957)
======================================================================
- duplicates
-
JDK-4054256 instance initializers should be able to throw exceptions
-
- Closed
-