Definition of interface

Source: Internet
Author: User
Tags definition data structures modifier modifiers

Technically, an interface is a set of data structures that contain a function-type method. With this set of data structures, client code can invoke the functionality of the Component object.

15.2.1 statement

An interface declaration is actually a type declaration that defines a new interface, and the format of the declaration is as follows:

Attributes Interface-modifiers interface identifier Interfacebase interface-body;

Interfaces can use the following modifiers:

New

Public

Protected

Internal

Private

The same modifier is not allowed to occur more than once in an interface definition, and the new modifier can only appear in nested interfaces, representing members of the same name that have inherited.

The Public,protected,internal,and private modifier defines the access rights to an interface.

In the declaration body of an interface, you can define the members of an interface. The members of an interface can be methods, properties, index indicators, and events.

The following example defines an interface named IControl that contains a member method paint:

Interface IControl
{
void Paint ();
}

Inheritance of the 15.2.2 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.