zoukankan      html  css  js  c++  java
  • 泛型

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
     
    namespace ConsoleApplication2
    {
       public class MyList<T>
        {
          private static int objCount = 0;
             public MyList()
          {
                 objCount++; 
             }
          public int Count
          {
           get{return objCount; }
          }
         }
        class Program
        {
            class SampleClass {}
            class MyClass
            {
                
            }
            static void Main(string[] args)
            {
               // Console.WriteLine(new MyList<SampleClass>().Count); 
                MyList<double> myDoubleList5 = new MyList<double>();
                MyList<double> myDoubleList6 = new MyList<double>();
                MyList<int> myIntList1 = new MyList<int>();
                MyList<int> myIntList2 = new MyList<int>();
                MyList<double> myDoubleList7 = new MyList<double>();
                MyList<int> myIntList22 = new MyList<int>();
              Console.ReadLine();
                  }
    }
     
    }
    
  • 相关阅读:
    nginx http和https共存
    jQuery prop方法替代attr方法
    idea内置tomcat中java代码热更新
    Linux磁盘空间查看、磁盘被未知资源耗尽
    Mysql order by与limit混用陷阱
    IIS 架构解析
    asp.net MVC 应用程序的生命周期
    Linq专题之var关键字
    ThoughtWorks 2016年第1期DNA活动总结
    对象的深拷贝--反射
  • 原文地址:https://www.cnblogs.com/bingguang/p/3155103.html
Copyright © 2011-2022 走看看