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();
                  }
    }
     
    }
    
  • 相关阅读:
    tomcat监控与优化
    rpm打包
    Rewrite和location 区别
    LNMP服务
    yum仓库脚本
    用户管理的脚本2
    pxe装机脚本
    用户管理的脚本1
    磁盘管理综合测试题
    MySQL 增量备份介绍及案例演示
  • 原文地址:https://www.cnblogs.com/bingguang/p/3155103.html
Copyright © 2011-2022 走看看