Java Programming thought note (interface)

Source: Internet
Author: User

1. Abstract classes and abstract methods:abstract void F (); 1. The class containing the abstract method is called an abstract class. If a class contains one or more abstract methods, the class must be qualified as abstract. 2. If you inherit from an abstract class and want to create an object of the new class, you must provide a method definition for all the abstract methods in the base class. If you do not (you can choose not to), then the exported class is also an abstract class, and the compiler will force us to qualify the class with the abstract keyword.
2. Interface:Interface instrument{//no implementations provided} class wind implements instrument{}
3. Complete decoupling:The Filteradapter constructor accepts the interface filter you have, and then generates an object with the process interface you need.
multiple inheritance in 4.Java:Implements,,,
5. Extend the interface through inheritance:Interface monster{} interface Dangerousmonster extends monster{}
5 (1). Name collisions when combining interfaces
6. Adapter Interface
7. Domains in the interface
7 (1). Initialize the domain in the interface
8. Nested interfaces:Interfaces can be nested in classes or other sockets
9. Interface and Factory:If it is not a factory method, your code must somewhere specify the exact type of service that will be created in order to invoke the appropriate constructor.

Java Programming thought note (interface)

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.