Can a Static Nested Class be Instantiated Multiple Times?
问题 Given what I know of every other type of static feature of programming––I would think the answer is 'no'. However, seeing statements like OuterClass.StaticNestedClass nestedObject = new OuterClass.StaticNestedClass(); makes me wonder. 回答1: Yes, there is nothing in the semantics of a static nested type that would stop you from doing that. This snippet runs fine. public class MultipleNested { static class Nested { } public static void main(String[] args) { for (int i = 0; i < 100; i++) { new