The following code won't compile, although if the new occurs in exactly the same block as the class declaration it is happy:
class t {
public static void main(String[] args) {
class ic { }
{
new ic();
}
}
}
class t {
public static void main(String[] args) {
class ic { }
{
new ic();
}
}
}
- duplicates
-
JDK-4037577 A block scoped class isn't seen by a reference from a nested block
- Closed