Bean inheritance in springAndInheritance in JavaDifferent. The former is a continuation of parameters between instances, while the latter is generally refined. The former is the relationship between objects, and the latter is the relationship between classes. Bean inheritance in spring differs from that in Java as follows:
①Spring neutron bean and parent bean can be of different types, but inheritance in Java ensures that child classes are a special parent class.
②Bean inheritance in spring is the relationship between instances, so it is mainly manifested as the continuation of parameter values, while inheritance in Java is the relationship between classes, mainly manifested as the continuation of methods and properties.
③Spring neutron beans cannot be used as parent beans and do not have polymorphism. Subclass instances in Java can be used as parent classes.