Packaging for Java

Source: Internet
Author: User

Inheritance, encapsulation, polymorphism are the three main features of Java. Make a note of the learning package today.

How to understand encapsulation? Encapsulation is literally to be sealed up, that is, to hide the information, refers to the use of abstract data types to encapsulate data and data-based operations together to form an indivisible independent entity, the data is protected in the abstract data type inside, as far as possible to hide the internal details, Only some external interfaces are retained to make them contact external.

The benefits of encapsulation include the following four points:

1, good package can reduce the coupling.

2, the structure within the class can be freely modified.

3, the member can be more precise control.

4, hidden information, implementation details.

In fact, these four points are bound together. How to understand it, the main purpose of encapsulation is to reduce the coupling between objects and objects. In the Great Leap Forward era, general, we all get together to eat, tune the truth we all understand, the taste of the pot change, everybody all have to bear, extremely not free. And the back of the household responsibility system, each Spacerl, home to cook the rice, the taste of the pot is not the same, so that more freedom, the taste of rice can be more precise control of the other people will not have too much impact on the taste of their own rice, and how to do other people do not know. To contact the time, open a door, welcome others to eat, others will know your taste, so that the realization of the interaction.

Packaging for Java

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.