Introduction: Recently in learning Spring, the feeling is still very rewarding, by the way sorted out the knowledge point, after nothing to see, learn ...
The bean inheritance in Spring is quite different from the inheritance in Java. The former is the continuation of the parameter value between the instance and the instance, the latter is from general to special refinement. The former is the relationship between object and object, and the latter is the relationship between class and class.
Therefore, the inheritance of the bean in Spring and the inheritance of the Bean in Java have the following differences:
1. The child beans and parent beans in Spring can be of different types, but in Java, subclasses are a kind of parent-class enhancement, a special parent class.
2. The inheritance of the bean in Spring is the relationship between the instances, which is mainly expressed as the continuation of the parameter values: and the inheritance in Java is the relationship between class and class, which is mainly manifested as the continuation of methods and attributes.
3. The Spring neutron bean cannot be used by the parent bean and is not polymorphic: The subclass instance in Java can be used entirely as a parent class instance.