Thinking in Java extract notes

Source: Internet
Author: User

/**

*
<P> title: </P>

*

*
<P> Description: </P>

* Both combination and inheritance allow setting sub-objects in the class. The combination is displayed and the inheritance is implicit.

* A combination is usually used when you need to use functions in the class instead of interfaces.

*

* You shall reserve the right to "change underlying implementation ".

* Why is "upward transformation" required "?

* The export class is the superset of the base class. That is to say, the export set may have more methods and metadata than the base class.

Su,

* The only possible occurrence of a class interface is the loss of the interface, rather than obtaining them.

*

* If it is necessary to transform upwards, inheritance is necessary.

* An object can be used either as its own type or as its base type. This is called "upward transformation ".

"Upcasting

*

*

*
"Dynamic binding" is also called "post-binding" and "runtime binding"

* When a subclass object is created, the base class object is referenced, and the base class object is used to call the overloaded method in the subclass

, Which will be dynamically bound to the subclass.

*

*/

/**

*
<P> title: </P>

*

*
<P> Description: </P>

*(
1) Hide implementation
Hiding

* Java access permission modifier, which isProgramThe library developers should specify to the client programmer which can be used and which cannot be used.

* You usually need to consider which Members want to be disclosed to the client programmer.

* Any method you think is a class assistant, you can set it to private

*(
2)

*

*

*
Class is used to create a new data type, instead of simply creating a data and method box. Each compilation unit can only have one public
Class

*

*/

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.