1. 程式人生 > >Exception in thread "main" java.lang.Error: Unresolved compilation problem: No enclosing instance

Exception in thread "main" java.lang.Error: Unresolved compilation problem: No enclosing instance

Exception in thread "main" java.lang.Error: Unresolved compilation problem: 
    No enclosing instance of type Lists is accessible. Must qualify the allocation with an enclosing instance of type Lists (e.g. x.new A() where x is an instance of Lists).

java程式碼出現上面問題

原因

Mian 方法是靜態  不能呼叫 非靜態方法