下面程序哪里错呢?(小白一个,别介)
public class Animal { public int age; public String name; 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.name="xiaotian"; dog.eat(); } }