代码
提交代码
public class Car1 {
String brand = "宝马";
static String name = "外部类的静态属性name";
// 静态内部类
static class Engine {
public void run() {
System.out.println(name);
}
}
public static void main(String[] args) {
Engine engine = new Engine();
engine.run();
}
}
运行结果