Java SE 21st----Abstract class

Source: Internet
Author: User
Tags java se

1. Abstract class: A class that uses the abstract keyword modifier is called an abstract class, and an abstract class cannot be instantiated , that is, an object of an abstract class cannot be new.

2. Abstract method: The method using the Abstract keyword modification is called an abstract method, there is no declaration of implementation (no curly brace public abstract void Method ();)

abstract methods need to be defined in an abstract class. In contrast to abstract methods, the previously defined methods are called concrete methods (with declarations, implementations).

3. If a class contains an abstract method, then the class must be an abstract class.

4. If a class is an abstract class, then the class can contain concrete methods (declarations are implemented).

5. If a class contains abstract methods, then the class must be declared abstract, that is, the class must be an abstract class, reproduction if a class is an abstract class, then the class can contain abstract methods and concrete methods.

Java SE 21st----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.