没有显示错误,但是运行不了
public class Outer {
private String name= "你好!";
public void show() {
class Inner{
int year=2018;
public int newYear() {
return year+1;
}
}
Inner i=new Inner();
int newyear=i.newYear();
System.out.println(name +newyear);
}
public static void main(String[] args) {
Outer o=new Outer();
o.show();
}
}
运行后是这样的
Error occurred during initialization of boot layer
java.lang.module.FindException: Error reading module: C:\Users\Administrator\Workspaces\MyEclipse CI\Lei\bin
Caused by: java.lang.module.InvalidModuleDescriptorException: Outer$1Inner.class found in top-level directory (unnamed package not allowed in module)
几个意思?