I am trying to print a really long character String using StringBuilder in Java. For ex. this code i'm using:-
repeat1=new StringBuilder();
for(j=0;j<long_string;j++)
repeat1.append('5');
System.out.print(repeat1);
The number of characters I am trying to print is more than (long_string=)80,000 or so. But the output gives a Runtime Error and the value that gets printed is Truncated after printing 65536 characters which I assume is the max +ve range of Characters in Java. Output is something like that :-
555555555555555555555555555555 ................................ ................................ ................................ ................................ 555555555555555555555555{-truncated-}
I don't know what I am doing wrong that it is not printing all the characters!!