

In Java, static methods in classes cannot directly call dynamic methods. The main program is public static class main.

The internal class I wrote is dynamic, that is, it starts with public class. )Looking at this prompt, I wondered why I have instantiated this class with new.Īs a result, Baidu Googles the relevant information. E refers to the internal class I wrote.įollow the prompts, There is no instance of internal class E that can be accessed, you must allocate an appropriate instance of internal class E (such as x. must qualify the allocation with an enclosing instance of type E (e.g. The result is: No enclosing instance of type E is accessible. When compiling and writing a book, I made up an internal class because there was only one part of the code in the book. Must qualify the allocation with an enclosing instance of type E (e.g. MustqualifytheallocationwithanenclosinginstanceoftypeE (e. The result is: NoenclosinginstanceoftypeEisaccessible.
