freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

net框架20新特性綜述(已修改)

2024-10-16 12:59 本頁(yè)面
 

【正文】 .NET框架 盧斌 Software Development Engineer Microsoft Corporation BCL 新功能 Serial port Compression Strongly typed resources Console support Threading Diagnostics Networking 。 Strongly Typed Resources 演 示 public class List { private object[] elements。 private int count。 public void Add(object element) { if (count == ) Resize(count * 2)。 elements[count++] = element。 } public object this[int index] { get { return elements[index]。 } set { elements[index] = value。 } } public int Count { get { return count。 } } } Generics “泛型 ” ListT private T[] elements。 id Add(T element) { public T this[int index] { List intList = new List()。 (1)。 (2)。 (“3)。 int i = (int)intList[0]。 1)。 // Argument is boxed 2)。 // Argument is boxed “3)。 // Should be an error [0]。 // Cast required Listint intList = new Listint()。 No boxing No boxing Compiletime erint i = intList[0]。 No cast required Generics “泛型 ” 為什么要 Generics? 編譯時(shí)類型驗(yàn)證 高性能 (不用裝箱 box, 不用轉(zhuǎn)換 downcasts) 減少代碼累贅 (typed collections) VB, C, MC++ 編寫和運(yùn)用 generics Generics國(guó)際 標(biāo)準(zhǔn)化 Generics in VB Public Class List(Of ItemType) Private elements() As ItemType Private elementcount As Integer Public Sub Add(ByVal element As ItemType) If elementcount = Then Resize(elementcount * 2) elements(elementcount) = element count += 1 End Sub Public Default Property Item(ByVal index As Integer) As ItemType Get Return elements(index) End Get Set (ByVal Value As ItemType) elements(index) = Value End Set End Property Public ReadOnly Property Count As Integer Get Return elementcount End Get End Property End Class Dim intList As New List(Of Integer) (1) ‘ No boxing (2) ‘ No boxing (“3) ‘ Compiletime error Dim i As Integer = intList(0) ’ No cast required Generics in C++ generictypename T public ref class List { arrayT^ elements。 int count。 public: void Add(T element) { if (count == elementsLength) Resize(count * 2)。 elements[count++] = element。 } property T default [int index] { T get() { return elements[index]。 } void set(T value) { elements[index] = value。 } } property int Count { int get() { return count。 } } }。 Listint^ intList = gew Listint()。 intListAdd(1)。 // No boxing intListAdd(2)。 // No boxing intListAdd(“3)。 // Compiletime error int i = intList[0]。 // No cast required 基礎(chǔ)類庫(kù)泛類 (Generics in BCL) classes ListT Dict
點(diǎn)擊復(fù)制文檔內(nèi)容
教學(xué)課件相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
公安備案圖鄂ICP備17016276號(hào)-1