zoukankan
html css js c++ java
基本类型数组
13
.
1
数组的类型转换
13
.
2
所有数组都隐式继承自
System.Array
13
.
3
所有数组都隐式实现
IEnumerable
,
ICollection
和
Ilist
13
.
4
数组的传递与返回
13
.
5
创建下界非
0
的数组
public
sealed
class
DynamicArrays
{
public
static
void
Main()
{
//
创建这样一个数组[2005
2009][1
4]
Int32[] lowerBounds
=
{
2005
,
1
}
;
//
第二维大小
Int32[] lengths
=
{
5
,
4
}
;
//
第一维大小
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();
}
}
13
.
6
数组访问性能
作者:
青羽
查看全文
相关阅读:
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
最新文章
Flash网页小游戏开发教程
DeepFace和GAN
hdu2587(递推)
timus1965(不错的贪心)
莫队算法
bitset
convex hull trick CF344.E
记一道智力题
RMQ模板
KMP模板
热门文章
扩展KMP模板
UVALive 5873 (几何+思维)
.关于oracle中varchar2的最大长度
面试必备之乐观锁与悲观锁
深入理解Java的反射机制
为了实现动态加载而编写的自己的ClassLoader
Java动态加载类
Java加载Class文件的原理机制
spring静态代理和动态代理
随笔
Copyright © 2011-2022 走看看