for循环完后不执行for循环外面的语句

yugongsong 2013-01-31 09:20:50
for (int i = 0; outDto != null && i <= outDto.length; i++) {
Dto oneDto = outDto[i];
String messID = (String) oneDto.get("messID"); // 短息模版id
String brID = (String) oneDto.get("brID"); // 客户号
String[] messcustid = new String[] {};
messcustid = brID.split(","); // 将多个客户分割成单个客户
for (int n = 0; n <= messcustid.length; n++) {
Dto inDto2 = new Dto();
inDto2.set("custid", messcustid[n]);
inDto2.setServiceName("batchMessage.selectcustPhone");
// 查询客户信息
Dto[] outDto1 = (Dto[]) DBUtil.query(inDto2);
Dto oneDto1 = outDto1[0];
String custname = (String) oneDto1.get("custname");
String custtitle = (String) oneDto1.get("sex"); // 客户男士
System.out.println("custtitle");
if(custtitle.equals("1")){
custtitle ="先生";
}
if(custtitle.equals("2")){
custtitle ="女士";
}if(custtitle == null){
custtitle ="";
}
String mobilephone = (String) oneDto1.get("mobilephone"); //客户手机号
String sendFlag = IfsSocketClient.sendSMS("尊敬的"+custname+custtitle+":在这特别的日子,祝你生日快乐" ,mobilephone);
if(sendFlag.equals("Y001")){
sendMessCount ++ ;
System.out.print("成功条数"+sendMessCount);
}
}
System.out.println("出来吧");


}


System.out.println("出来吧"); 打印不出来 谁知道为什么啊



...全文
678 8 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
chenlu123456789 2013-01-31
  • 打赏
  • 举报
回复
第二个for循环的循环条件也会越界吧!
365810247 2013-01-31
  • 打赏
  • 举报
回复
try catch一下.就会有异常了.
365810247 2013-01-31
  • 打赏
  • 举报
回复
for (int i = 0; outDto != null && i <= outDto.length; i++) { 这一句会越界.应该i <outDto.length 仔细查一下吧.
菖蒲老先生 2013-01-31
  • 打赏
  • 举报
回复
成功条数 有打印出来么,可能压根就没有进第一层for循环。。。 debug试试。。。
王者_来归 2013-01-31
  • 打赏
  • 举报
回复
要么出现异常了,要么是死循环。try一下。
鸡肋啊 2013-01-31
  • 打赏
  • 举报
回复
引用 楼主 yugongsong 的回复:
for (int i = 0; outDto != null && i <= outDto.length; i++) { Dto oneDto = outDto[i]; String messID = (String) oneDto.get("messID"); // 短息模版id String brID = (String) oneDto.get("brID"); // 客……
给messcustid数组定义的时候加个长度试试
LIFANBAIOSDN 2013-01-31
  • 打赏
  • 举报
回复
String[] messcustid = new String[] {};这是要干什么?这个数组里没有数据 你下面又循环....
General-M 2013-01-31
  • 打赏
  • 举报
回复
循环完没有异常吗,一直在里面循环?可以debugger一下

81,122

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧