using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Collections;namespace ConsoleApplication1{ public class MyTest : IEnumerator { public object Current { get { return null; }
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace 鏈表{ class Program { static void Main(string[] args) { Note<int> temp = new Note<int>();
1、什麼是ArrayList ArrayList就是傳說中的動態數組,用MSDN中的說法,就是Array的複雜版本,它提供了如下一些好處:動態增加和減少元素 實現了ICollection和IList介面 靈活的設定數組的大小2、如何使用ArrayList 最簡單的例子:ArrayList List = new ArrayList();for( int i=0;i<10;i++ ) //給數組增加10個Int元素List.Add(i);
在部落格園中看到別人對靜態建構函式的解釋。自己也不是很明白順便學習一下using System;using System.Collections.Generic;using System.Text;namespace ConsoleApplication1{ public class Test { static Test() { Console.WriteLine("我是靜態構造方法"); }
本節內容:類和結構的區別、類成員、按值和按引用傳送參數、方法重載、建構函式和靜態建構函式、唯讀欄位、部分類、靜態類、Object類(基類)。一、類和結構類用class修飾,結構用struct修飾。如: 1 class PhoneCustomer 2 { 3 public const string DayOfSendingBill="Monday"; 4 public int CustomerID; 5 public string FirstName; 6
雜湊表Hashtable是一個重要的集合類型,下面我來對他的基本用法做個小小的總結。1、Hashtable的概述Hashtable它表示鍵/值對的集合,這些鍵/值對根據鍵的雜湊碼進行組織。它的每個元素都是一個儲存在DictionaryEntry對象中的鍵/值對,鍵不可為空引用,但值可以。Hashtable常用的兩種建構函式:public Hashtable() public Hashtable(int
using System;using System.Collections.Generic;using System.Text;using System.Collections;namespace MyLunch{ /// <summary> /// switch的用法 /// </summary> /// public class Number { ArrayList list = new ArrayList();