This understanding is object-oriented. ^

Source: Internet
Author: User

Targeting your wife

 

If you tell her "Pour tea", she will make the tea better. If you say "wife, clothes, color = Red", she will change her red clothes. When your wife cooks, she will generate a "help" event. Of course, you can choose not to handle this event: P. You can let your wife have a baby. This is inheritance. The wife won't tell you how much money she has. This is encapsulation. The wife is happy and unhappy, this is "polymorphism "......

 

Your wife is targeting you.

 

She told you to "Pour tea" and you will get tea ready. She said "husband. Cigarettes. Enable = false", and you will quit cigarettes. When you cook for your wife, you will have a "help" event. Of course, she can choose to handle or not handle this event: P. If your wife doesn't want to have a baby, you don't have to be inherited. If you save your private money, this is encapsulation. If you pick up a girl outside, you can treat it like a girl, this is a "polymorphism". My wife asks you to clean the house and clean up all the room garbage. This is called loop traversal. The garbage found is packed in the garbage belt, which is called packing, the garbage is thrown into the garbage bin downstairs, which is called garbage cleaning. Suddenly you find that you accidentally threw the newspaper with your own private house money into it, and you have to go to the garbage collection to flip it out. This is called unpacking, after searching for a long time, I couldn't find it. I found that the garbage had been cleared by the cleaning engineer. I stood beside the garbage bin, so it was suspended.

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.