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();
                  }
    }
     
    }
    
  • 相关阅读:
    eclipse 中 debug-config
    release稳定版本/snapshot快照版本
    nginx.config文件配置
    用 Spring Boot 和 MybatisPlus 快速构建项目
    github 生成ssh key
    Vagrant安装virtualbox
    修改linux默认时区
    《加密与解密》笔记
    manjaro 安装显卡驱动
    排序算法-C++实现
  • 原文地址:https://www.cnblogs.com/bingguang/p/3155103.html
Copyright © 2011-2022 走看看