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();
                  }
    }
     
    }
    
  • 相关阅读:
    Java JDBC 连接ORACLE ORA-12505错误解决方法
    SqlServer 打开/关闭列自增
    【小程序】倒计时
    【MySQL 主从同步延迟的原因及解决办法】
    【Linux Mysql主从配置】整理主从配置遇到的坑!
    关于post和get传递参数的区别
    CSS基础属性介绍
    js-06-字符串
    js-07-事件
    js-08-数组学习
  • 原文地址:https://www.cnblogs.com/bingguang/p/3155103.html
Copyright © 2011-2022 走看看