"PHP" Object-oriented (iv)

Source: Internet
Author: User

Knowledge Point: AI
One, A and abstract (abstraction Class)
A) modifiers for abstract classes, decorated classes, and Member methods
b) Note: The modified class cannot be instantiated, and the modified method cannot have a program body
c) If a class is decorated with an abstract, it means that he has an incomplete member method, two solutions, either we implement the unfinished method in this class, or we let the subclass inherit him and complete the unfinished function before it can be instantiated!
II, I = Interface (interface)
A) interface declares an interface class
b) interface can contain only constant definitions, and Member methods
c) Note: The Member method cannot have a program body inside the interface class
d) Interface interface class We can only use implements to implement, but not to use extends inheritance
e) Using interface declaration of the interface class, not a function is implemented, can only let subclasses use implements to implement all of its functions or part of the function, if the subclass is only part of the function, subclass or an abstract class, at this time, only let grandson class to implement all the functions, The interface class is now implemented!
Three main characteristics of object-oriented:
A) package
b) Inheritance
c) polymorphic
I. Allowing a class to do many aspects of work

"PHP" Object-oriented (iv)

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.