"JAVA" interface

Source: Internet
Author: User

Interface Concepts:

  1. is a collection of abstract methods (public abstract implicitly thinks, and only), non-abstract class inheritance must implement all methods;
  2. Variables that can contain static and final declarations (public static final default, and only);

Tag interface uses:

To create a common parent interface:

  • As with the EventListener interface, which is a Java API that is extended by dozens of other interfaces, you can use a markup interface to create a parent interface for a set of interfaces. For example: When an interface inherits the EventListener interface, the Java Virtual Machine (JVM) knows that the interface will be used for an event's proxy scenario.

To add a data type to a class:

  • This situation is the initial purpose of the markup interface, the class that implements the tag interface does not need to define any interface methods (because the markup interface has no method at all), but the class becomes an interface type through polymorphism.

"JAVA" 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.