zoukankan      html  css  js  c++  java
  • ArrayList 数组链表

       System.Collections;
          是一个数组链表,具有数组的功能,也有链表的特色。

    View Code
     1 using System;
     2 using System.Collections.Generic;
     3 public class StudyList1
     4 {
     5     public static void Main()
     6     {
     7         List<IWuDang> list = new List<IWuDang>();
     8         list.Add(new People(){Name = "one"});
     9         list.Add(new People(){Name = "two"});
    10         list.Add(new People(){Name = "three"});
    11         list.Add(new People(){Name = "four"});
    12         foreach(IWuDang p in list)
    13         {
    14             p.GongFu();
    15         }
    16 
    17         
    18     }
    19 }
    20 public interface IWuDang
    21 {
    22     void GongFu();
    23 }
    24 public class People:IWuDang
    25 {
    26     private string name = "";
    27     public string Name
    28     {
    29         get{return this.name;}
    30         set{this.name = value;}
    31     }
    32     public void print()
    33     {
    34         Console.WriteLine(this.name);
    35     }
    36     public void GongFu()
    37     {
    38         Console.WriteLine("太极");
    39     }
    40 }
  • 相关阅读:
    030-B+树(三)
    028-B+树(一)
    027-B树(二)
    026-B树(一)
    025-红黑树(六)
    024-红黑树(五)
    023-红黑树(四)
    022-红黑树(三)
    021-红黑树(二)
    020-红黑树(一)
  • 原文地址:https://www.cnblogs.com/QLJ1314/p/2622915.html
Copyright © 2011-2022 走看看