Kishor Joshi wrote:
Which tool or Ide I should use to view all numbers?
Isn't it easier to just redirect standard output to a file? Practically all command windows (or tool output windows) will truncate -- or it can theoretically run out of memory holding all that history.
That is simply a formatting problem. Find out how to format your output with the % tags. You can find out about that in the Formatter class and in several places in the Java Tutorials: 123. No 3 is about formatting classes like DecimalFormat, so use no 1 + 2.
Also avoid multiple print instructions. If you can join the three instructions in lines 34‑36 into one instruction you can probably improve performance. Maybe only by a few milliseconds, but in 5000 lines that makes several seconds.
Kishor Joshi wrote:If I use arraysize like 2000 I am getting all number starting from 0 to 1999
Erm...because that's what you've coded?
Arrays have a fixed size - which you appear to have redundantly assigned to arraySize - and a generic "print" method can't possibly know what portion of that array contains the things you want to display unless you tell it.
A List, on the other hand, contains only as many elements as you've supplied to it, so it will only print out that many.
So maybe the answer is to use a List, rather than an array.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here