JAVA println太长,java System.out.println()奇怪的行为长字符串

Can somebody explain me why this code does not print the numbers?

String text = new String("SomeString");

for (int i=0; i<1500; i++) {

text = text.concat(i+"");

}

System.out.println(text);

Result

SomeString

If I lower the number of runs to 1000 it works, why?!

And also if I add not only a number but also a character, it works.

Ok New Update:

Thanks for the code examples. I tried them all but what I found out is, that the console

actually display the numbers but only in fontcolor white. But the first part of the String

SomeString is black.

I use jdk1.7.0_06 !

解决方案

This is eclipse bug. Fixed width console fixes the output.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值