当前位置:
代码迷
>>
J2SE
>> 为什么数组上标(index)只能为int不能为long
详细解决方案
为什么数组上标(index)只能为int不能为long
热度:
9151
发布时间:
2013-02-25 21:54:44.0
为什么数组下标(index)只能为int不能为long?
数组下标如果允许为long的话,岂不是可以储存更多元素?仅仅允许int类型作为数组下标,是不是有点太吝啬了?或者说,这么规定是有理由的?
要在实用和效率之间权衡
引用:
楼主知道java int的最大值是多少吗
一个小标为int的byte数组全部放满东西需要的内存为(2^31+1)*1b=2Gb=0.25GB
一个小标为long的byte数组全部放满东西需要的内存为(2^63+1)*1b
请问,楼主的机器有这么大的内存吗?int应该够用了。如果不够用,还可以想其他办法替换,比如用多维数组。
相关解决方案
index.jsp经过模拟action接口 转发 到login.jsp页面后,页面背景无法显示
Parameter index out of range (五 > number of parameters, which is 4)
this id generator generates long, integer, short 异常
oracle 安插 LONG VARCHAR 类型数据
小白请问: 关于 index.jsp 中 isValid() == false的异常。 就剩20分了.对不住各位了><
为什么数组上标(index)只能为int不能为long
menu控件 异常 索引必须位于该列表的界限内。 参数名: index
Index”并不包孕“productType1”的定义
jquery index()的有关问题帮小弟我看下这行代码错在哪
指定的参数已超出有效值的范围。 参数名: index,该怎么解决
<a href='MyPhoto.aspx?DelID=<%# Eval("album_id") %>&index=hddnPageIndex.value' />解决方法
数据类型的转换<long->string->long>该如何解决
<div id="Layer25" style="position: absolute; width: 127px; height: 67px; z-index: 35
<div id="Layer25" style="position: absolute; width:1000px; height:1000px; z-index: 35; background-color:red,该如何处理
|M|小弟我也有搞鬼 <div style="position: absolute; width: 1000px; height: 1000px; z-index: 35; background-color:red"
OnClick=window.open("/index.aspx")出错?解决思路
虚拟主机 index.htm解决办法
int index = int.Parse(e.CommandArgument.ToString());该怎么处理
为什么int index = Convert.ToInt32(e.CommandArgument);取不到值呢。解决思路
|M| 在网上考下来的一个操作ListBox的JS代码 无法实现options(index).value出错。要如何改 多谢
Index was outside the bounds of the array解决方法
6085平台,由于编译文件太多了,出现argument too long 异常,应该如何解决
Declare Function GetSystemMetrics Lib "User32" (ByVal nIndex As Long) As Long,该如何解决
初学者!MATLAB异常 Index exceeds matrix dimensions
请教register unsigned long _res asm ("ax");是什么意思
informix 在跑语句是报长事务的错:long transaction detected,应该如何解决
php mvc 透过 htaccess 隐藏 index.php 或 index.php?arg=
《Pro Oracle SQL》Chapter3-3.2 Index Scan Access Methods-3.2.1 Index Structure
sorry,long time no see.该如何解决
(51)So long, see you Next Year!该怎么解决