zoukankan      html  css  js  c++  java
  • 基本类型数组

    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数组访问性能
  • 相关阅读:
    1.Spring MVC详解
    servlet的九大内置对象
    Hibernate设置事务的隔离级别
    wamp下php报错session_start(): open(d:/wamp/tmpsess_ku776hvb06ko4lv9d11e7mnfj1, O_RDWR) failed: No such file or directory
    json_decode()相关报错
    wamp下var_dump()相关问题
    es6箭头函数内部判断
    Json数组对象取值
    npm指向淘宝源
    APICloud之封装webApp
  • 原文地址:https://www.cnblogs.com/tenghoo/p/1204239.html
Copyright © 2011-2022 走看看