关于C#中ICollection接口的使用方法
C#中ICollection接口的使用方法
使用vs创建控制台应用
1.完整代码示例
// An highlighted block using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; namespace Study { class Program { static void Main(string[] args) { int[] b = new int[] { 1, 2, 3, 4 }; int[] a = new int[] { 2, 1, 2, 1, 2, 11, 2 }; //ICollection的用法在此 此时 c的值=b,但是方法继承自ICollection,而不是来自于b的Array ICollection c = b; //可以用VS在CopyTo代码上按F12 查看该方法的基类。 // b.CopyTo(a,0); //b的基类是Array c.CopyTo(a, 0); //c的基类是ICollection foreach (int i in a) { Console.Write(i + " "); } Console.ReadLine(); } } }
2.编程工具以及界面显示
希望您有所收获
本网页所有视频内容由 imoviebox边看边下-网页视频下载, iurlBox网页地址收藏管理器 下载并得到。
ImovieBox网页视频下载器 下载地址: ImovieBox网页视频下载器-最新版本下载
本文章由: imapbox邮箱云存储,邮箱网盘,ImageBox 图片批量下载器,网页图片批量下载专家,网页图片批量下载器,获取到文章图片,imoviebox网页视频批量下载器,下载视频内容,为您提供.
阅读和此文章类似的: 全球云计算