I have tried to look out for the error which says that its VM dependent, that is virtual memory dependent,i tried this code which gave me the following error
Exception in
thread "main" java.lang.OutOfMemoryError: Requested array size exceeds
VM limit so i decided to run a series of program code with the help of loop and find out ,the final code i ran was this which would be a bit clear
which gave me the following constant output when i ran this 4-5 times
15475321
15475322
15475323
15475324
15475325
15475326
15475327
15475328
15475329
15475330
15475331
15475332
15475333
15475334
15475335
15475336
15475337
15475338
15475339
15475340
15475341
15475342
15475343
15475344
15475345
15475346
15475347
15475348
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space and mentioning that my virtual memory is set to 1536-3072
if the program give same output on your machine that note that u can have it as
15475348 which i think will not be true,otherwise u can have this as VM dependent.
Thanks and Regards, Anand
SCJP 5.0 310-055 73%, SCWCD 1.4 310-081 78%, IBM DB2 9 Fundamentals 000-730 62%