7.8.3: differences between bean inheritance and Java inheritance

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.