java--interface

Source: Internet
Author: User
1. Three major features of object-oriented programming:
* Package/Hide
* Interface
* polymorphic
-In order to apply a variety of changes in demand, the code becomes more general!
2. A class is an abstraction of an object, and inheritance is an abstraction of a batch of classes, thus enabling better modeling of the real world.
3. Improve the reusability of the code.
Extends means "extension". The subclass is the inheritance of the parent class.


4. A single source file can define multiple classes.
5. Subclass inherits the parent class and can get all the properties and methods of the parent class (except the parent class's constructor method)
There is only single inheritance in 6.java, and there is no multiple inheritance like C + +. Multiple inheritance can cause confusion, making inheritance even too complex and systems difficult to maintain. Just like in the real world you have multiple parents.
7. Multi-inheritance is to realize the reusability of code, but introduces the complexity, which makes the relationship between the classes of the system chaotic
Multiple inheritance in 8.java, which can be implemented through an interface.
9. If you define a class without calling extends, its parent class is: Java.lang.Object
10. Different names: Super class, parent class, base class, subclass, derived class

java--interface

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.