Java---abstract abstraction

Source: Internet
Author: User

1. Abstract Abstraction Class

(1) Abstract is used to modify methods and classes.

(2) The abstract method allows only declarations that do not allow implementations. Neither method nor method body. No curly braces.

(3) The class with the abstract modifier does not allow new to be used to create the object.

(4) Abstract methods must be in the abstract class, but abstract classes can also have a non-abstract method.

(5) The method in the abstract class, to be used, must inherit the abstract class with a class, and invoke the method in the abstract class by creating the subclass object. Override methods to invoke abstract methods in an abstract class.

(6) Abstract classes are generally used for inheritance and then used in polymorphic form.

(7) A subclass is also an abstract class if it overrides only a subset of the parent class's abstract methods. Because the subclass inherits an abstract method of the parent class, and the previous saying that the abstract method must exist in the abstract class, the subclass must override all abstract methods in the parent 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.