Javascript based on three major characteristics of objects (encapsulation, inheritance, polymorphism) _ javascript skills

Source: Internet
Author: User
This article mainly introduces three main features of Javascript based on objects, including encapsulation, inheritance, and Polymorphism. if you are interested, you can refer to the three features of Javascript based on objects and C ++, java object-oriented features are the same as those of encapsulation, inheritance, and polymorphism ). However, the implementation methods are different, and their basic concepts are similar. In fact, apart from the three main features, there is also a common feature called abstract, which is why we sometimes see four features of object-oriented in some books.
I. encapsulation
Encapsulation encapsulates the abstracted data and the operations on the data, and the data is protected internally. other parts of the program are only authorized operations (member methods ), to operate the data.
Case:

        

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.