您当前的位置: 首页 >  c#

彭世瑜

暂无认证

  • 2浏览

    0关注

    2791博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

C#编程-98:索引器在接口中的使用

彭世瑜 发布时间:2017-08-05 23:00:41 ,浏览量:2

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace InterfaceTest
  7. {
  8.     public interface IIndexTest
  9.     {
  10.         int this[int index]
  11.         {
  12.             set;
  13.             get;
  14.         }
  15.     }
  16.     class Indextest : IIndexTest
  17.     { 
  18.     private int[] myint=new int[10];
  19.     public int this[int index]
  20.     {
  21.         set
  22.         {
  23.             if (index >= 0 && index 
关注
打赏
1665367115
查看更多评论
立即登录/注册

微信扫码登录

0.0575s