What's the advantage of making an inner class as static with Java?
问题 I have an inner class in my Java class. When I run find bugs, it recommends(warns) to make it as static. What's the point of this warning? What's the advantage of making a inner class as static? 回答1: If the nested class does not access any of the variables of the enclosing class, it can be made static. The advantage of this is that you do not need an enclosing instance of the outer class to use the nested class. 回答2: An inner class, by default, has an implicit reference to an object of the