• 基本类型数组


    131数组的类型转换

    132所有数组都隐式继承自System.Array

    133所有数组都隐式实现IEnumerableICollectionIlist

    134数组的传递与返回

    135创建下界非0的数组

    public sealed class DynamicArrays {
            
    public static void Main() {
                
    //创建这样一个数组[20052009][14]
                Int32[] lowerBounds =20051 };//第二维大小
                Int32[] lengths =54 };//第一维大小
                Decimal[,] quarterlyRevenue = (Decimal[,])
                  Array.CreateInstance(
    typeof(Decimal),lengths,lowerBounds);
                Console.WriteLine(
    "{0,4}{1,9}{2,9}{3,9}{4,9}""Year""Q1""Q2""Q3""Q4");
                Int32 firstyear 
    = quarterlyRevenue.GetLowerBound(0);//2005
                Int32 lastyear = quarterlyRevenue.GetUpperBound(0);//2009
                Int32 firstQuarter = quarterlyRevenue.GetLowerBound(1);//1
                Int32 lastQuarter = quarterlyRevenue.GetUpperBound(1);//4
                for (Int32 y = firstyear; y <= lastyear; y++)
                
    {
                    Console.WriteLine(y 
    + " ");
                    
    for (Int32 q = firstQuarter; q <= lastQuarter; q++)
                        Console.Write(
    "{0,9:C}", quarterlyRevenue[y, q]);
                    Console.WriteLine();
                }

                Console.ReadLine();

            }

        }
    136数组访问性能
  • 相关阅读:
    搭建WAP应用开发环境
    How To Recover Openfire admin Password
    Domino分区服务器的安装与设置
    apache安全加固
    apache的web文件根目录
    iis绑定域名
    dedecms出现Error: Errno:0 SQL::错误解决方法
    加入收藏兼容ie和火狐
    phpcms毛遂
    .htaccess文件
  • 原文地址:https://www.cnblogs.com/tenghoo/p/1204239.html
Copyright © 2020-2023  润新知