摘要: 1.泛型 封装的数据不指定特定类型,而在声明或实例化期间指定类型,以最大限度的重用代码、保护类型安全。 ```C# class Queue { private const int DEFAULTQUEUESIZE = 100; private int head=0, tail=0; private 阅读全文
posted @ 2021-03-10 15:26 葡式蛋挞 阅读(10) 评论(0) 推荐(0)
摘要: 1.索引器类似于属性,使用一个或多个参数引用属性,索引值指定要访问哪一个元素。 ```C# class Wrapper { private int [] bottle; // 属性 public int [] Bottle { get => this.bottle; set => this.bott 阅读全文
posted @ 2021-03-10 12:32 葡式蛋挞 阅读(10) 评论(0) 推荐(0)