-
Bug
-
Resolution: Fixed
-
P5
-
1.1, 1.1.4, 1.2.0
-
1.2beta2
-
generic, sparc
-
generic, solaris_2.5.1
-
Not verified
Name: mc57594 Date: 03/10/97
javac successfully compiles the following code even though a
class named "foo" is nested in another class named "foo."
(Acutally, javac only generate class file for one of the "foo"
classes.)
Executing the program would result in run time error.
------------------------
public class TestNested {
public static void main(String[] args) {
class foo {
class foo {
void printMsg() { System.out.println("howdy"); }
}
void printMsg() {
foo foo1 = new foo();
foo1.printMsg();
System.out.println("Hello");
}
}
foo foo1 = new foo();
foo1.printMsg();
}
}
company - University of California, Irvine , email - ###@###.###
======================================================================
- duplicates
-
JDK-4094585 Javac allows inner classes to have the same name as an enclosing class.
- Closed