谁能告诉我,我这个代码为什么下划处报错了
public class HelloWorld {
public class Animal {
int age;
public void eat() {
System.out.println("吃");
}
}
public class Dog extends Animal {
}
public static void main(String[] args) {
Dog dog = new Dog();
dog.age = 10;
dog.eat();
}
}
谁能告诉我,我这个代码为什么下划处报错了