I have the following java classes:
public class Outer { ... private class Inner { ... } ... } Assume I am inside a non-static method of Outer. Does it make a difference whether I call this.new Inner() or new Outer.Inner()? Is it, in the second case, guaranteed that no new Outer is created?
I have an annoying error in my program that appears only sometimes and is hard to find or to reproduce. So I am wondering if this line could make any problems.
this.new Inner()ornew Outer.Inner(), you can declare your inner class asstaticclass.private static class Innernew Outer().new Inner(). But wouldn't it be more helpful for your search to post the error you are trying to resolve?Outerinstance? Since you do not specify its constructor parameter it is not possible that a custom constructor will be invoked and therefore not possible anotherOuteris created.