Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Java SE 综合讨论区  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 Re:[菜鸟cargo的问题]20060315(Re: length) [Re:cargo]
cargo





发贴: 7
积分: 0
于 2006-03-16 01:08 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
谢谢大家了,
可是对二维数组自动填充的时候:
for (int i=1;i<balance.length;i++)
{
   for (int j=0;j<balance[i].length;j++)
   {
     double oldBalance=balance[i-1][j];
     double interest=oldBalance*interestRate[j];
     balance[i][j]=oldBalance+interest;
   }
}

二维数组可以理解成“小数组的数组”,如果中间那个“for”循环是给每“行”小数组按列赋值的话,那么外面的“for”循环就是确定了小数组的行数。
那么第一个for中的“i<balance.length”似乎不太合理,它的意义是整个二维数组中的所有小数组的个数,而不是行数,对吗?




话题树型展开
人气 标题 作者 字数 发贴时间
7200 [菜鸟cargo的问题]20060315(Re: length) cargo 138 2006-03-15 14:41
5977 Re:[菜鸟cargo的问题]20060315 Skybus 401 2006-03-15 15:04
5842 Re:[菜鸟cargo的问题]20060315(Re: length) why 741 2006-03-15 17:30
5962 Re:[菜鸟cargo的问题]20060315(Re: length) leior 47 2006-03-15 18:15
6126 Re:[菜鸟cargo的问题]20060315(Re: length) surroad 10 2006-03-15 18:40
5913 Re:[菜鸟cargo的问题]20060315(Re: length) Skybus 111 2006-03-15 18:52
5982 Re:[菜鸟cargo的问题]20060315(Re: length) cargo 399 2006-03-16 01:08
6158 Re:[菜鸟cargo的问题]20060315(Re: length) jackyangf 246 2006-03-17 14:54
6249 Re:[菜鸟cargo的问题]20060315(Re: length) jackyangf 188 2006-03-17 14:57
6048 Re:[菜鸟cargo的问题]20060315(Re: length) cargo 121 2006-03-20 16:23

flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923