Java interface knowledge point

Source: Internet
Author: User

Java interface knowledge point

1. The class can implement multiple interfaces;

2. The basic unit of object-oriented programming is type );

3. The interface is a design expression;

4. The interface is not implemented;

5. You cannot create an interface instance;

 

6. How to declare the interface:

 

Public interface comparable {

}

7. How to declare the interface:

Use the keyword interface;

8. Which three types of members can be declared through the interface;

A. constant;

B. method;

C. Nested classes and interfaces;

9. constants declared in the interface are implicitly public, static, and final;

10. Static methods cannot be abstracted;

 

11. methods defined in interfaces are implicitly defined as abstract;

12. interfaces can inherit multiple interfaces;

13. The interface defines a type through abstract conventions;

14. A class can only inherit one other class;

15. The interface provides a method of multi-inheritance;

16. abstract classes provide partial or full implementations;

17. Any Main class to be inherited, whether abstract or not, should be the implementation of an interface;

18. mark an interface as an interface that does not declare any methods;

19. The interface can be inherited using the keyword extends.

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.