Why can’t you stop buying 618?From the technical dimension to explore>>>
publicclassA{
publicclassB{
}
};
When you need to instance class B, according to the positive logic, A.B AB = new a.b()
Then the compiler will have an error — “is not an enclosing class”
Then look at the relevant java code, found that the original writing error! The right thing to do is
[java]
view plain
copy
Aa=newA();
A.Bab=a.newB();
a class in a class without static cannot be operated with an external class. An instance must be used to instantiate the class in the class
Similar Posts:
- [Problems with the use of internal classes] No enclosing instance of type Outer is accessible. Must qualify the allocation with an enclo
- Java error: No enclosing instance of type E is accessible. Must qualify the allocation with an enclosing
- 【Java】No enclosing instance of type XXX is accessible. Must qualify the allocation with an enclos…
- The jar file rt.jar has no source attachment appears in eclipse
- -bash: locate: command not found
- [Solved] Cannot make a static reference to the non-static field logMongoTemplate
- Android Error: open failed: EACCES (Permission denied)
- Access permission problem caused by object. Clone() method
- bug_ _ android.view.WindowManager$BadTokenException: Unable to add window — token