How to add indexer to an interface

interface with indexer

An interface can specify an indexer. An indexer declared in an interface has this general form:


// interface indexer// w  w w .j  a  v  a  2  s .c o  m
element-type this[int index] {
   get;
   set;
}




















Home »
  C# Tutorial »
    Custom Types »




C# Class
C# Struct
C# Interface
C# Inheritance
C# Namespace
C# Object
C# Delegate
C# Lambda
C# Event
C# Enum
C# Attribute
C# Generics
C# Preprocessor