zoukankan      html  css  js  c++  java
  • clr via c# Array2

    1,Array类型生成方式以及实际类型

    private static void ArrayIntro() {
          String[] sa = new String[1];
          Array a1 = Array.CreateInstance(typeof(String), new Int32[] { 1 }, new Int32[] { 0 });
          Array a2 = Array.CreateInstance(typeof(String), new Int32[] { 1 }, new Int32[] { 1 });
          Console.WriteLine(sa.GetType().ToString());
          Console.WriteLine(a1.GetType().ToString());
          Console.WriteLine(a2.GetType().ToString());
       }
    //System.String[]
    //System.String[]
    //System.String[*]


    2,Array 的维度---used Rank to 指示数组的秩.

     private static void ArrayRankInfo(String name, Array a) {
          Console.WriteLine("Number of dimensions in "{0}" array (of type {1}): ",
             name, a.GetType().ToString(), a.Rank);
          for (int r = 0; r < a.Rank; r++) {
             Console.WriteLine("Rank: {0}, LowerBound = {1},  UpperBound = {2}",
                r, a.GetLowerBound(r), a.GetUpperBound(r));
          }
          Console.WriteLine();
       }

    3,Array-----其他特性...


  • 相关阅读:
    Java8新特性详解
    RedisTemplate详解
    RestTemplate详解
    windows中将多个文本文件合并为一个文件
    commons-lang 介绍
    commons-cli介绍
    commons-collections介绍
    commons-codec介绍
    commons-beanutils介绍
    commons-io介绍
  • 原文地址:https://www.cnblogs.com/frogkiller/p/12284585.html
Copyright © 2011-2022 走看看