# 类和类型 ## aop ### template ```java public class Main { static class Human { String label; public String getLabel() { return "Human"; } } static class Employee extends Human{ public String getLabel() { return "$code"; } } public static void main(String[] args) throws IOException { Human joe = new Employee(); System.out.println(joe); } } ``` 我们有两个类型: ```java class Human { String label; public String getLabel() { return "Human"; } } class Employee extends Human{ public String getLabel() { return "Employee"; } } ``` 现在我们有对象 ```java Human joe = new Employe(...) ``` 调用 `joe.getLable()` 的时候,返回的是? ## 答案 Employee ## 选项 ### A Human ### B HumanEmployee ### C Main$Employee@7a81197d ### D Main$Human@7a81197d