Head First Java Chapter 8 interface and abstract class

Source: Internet
Author: User
Abstract classes are often used to characterize the abstract concepts we derive in the analysis and design of the problem domain, as an abstraction of a series of concrete concepts that look different, but are essentially the same, and we cannot instantiate them (not get a concrete one) so they are called abstractions. For example: We want to describe "fruit", it is an abstraction, it has quality, volume and other common (fruit quality), but also lack of characteristics (apples, oranges are fruits, they have their own characteristics), we can not get the only one to represent the fruit of the thing (because apples, oranges can not represent fruit), Abstract classes can be used to describe it, so abstract classes cannot be instantiated. When we use a class to describe "Apple", this class can inherit the abstract class describing "fruit", we all know that "Apple" is a kind of "fruit".

That is, overriding the parent method, but not completely overwriting, is adding something else, then using super to call the parent class's original method and then add the part to add;

Head First Java Chapter 8 interface and abstract class

Related Article

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.