Stand on a magnum opus talk about generics (reprint)

Source: Internet
Author: User

This series of content, based on two magnum opus: "Thinking in Java" (fourth edition) and "Effective Java" (second edition). This series is from these two masterpieces, but from another perspective, you will reap some different knowledge of the generic system content. This series includes the following eight:

The first section: "The origin of generics", only understand the background and causes of generics, understand the generics to solve what problems arise, you can understand its role.

Section II: The authorizing of generics, this section is an extension of the previous section, focusing on the concept of "container". Laid the groundwork for the following.

Section III: "Generic Syntax Indicators", this section focuses on generic syntax, including:<t>,t,<?>, you think you can understand it, no, I do not believe, I think there is not enough time to study them, your understanding just stay on the surface above.

The fourth section: "Generic type", generics have many kinds, generic type, interface generic, method generic, this section of the content, you just seriously read "Thinking in Java", I believe you will not be unfamiliar.

Fifth: The difference between <?> and <Object>, this section of the content is to let you change hankered, let you from another angle to understand the generics, but also the above sections of the content of the sublimation.

Sixth: Covariance and contravariance, the content of this section will be controversial, but learning generics you have to understand these two concepts: covariance and contravariance.

The seventh section: <? Extends E > and <? Super E > behind the idea: the classification of the container, this part of the content feel "thinking in Java" is not good to explain, and "effective Java" is an academic, and the content of this section will let you refreshing, and deep understanding of the great universal.

The eighth section: "Generics instantiation", this part of the content is not many, but also should understand and grasp. As a type, both specific and parameterized, should be able to instantiate, which is what this section is about.

This article is from: Stand on the magnum opus and talk about generics

Stand on a magnum opus talk about generics (reprint)

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: 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.