Hi all.
I am still a greenhorn.I wrote the following program:
As far as i can see, there's no problem (but then I'm greenhorn
)
But when i run the code, it displays numbers at each position as expected.But it also displays the following message:
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 8, Size: 8
at java.util.ArrayList.RangeCheck(ArrayList.java:546)
at java.util.ArrayList.get(ArrayList.java:321)
and its displayed for different index every time.Sometimes for Index 4 and sometimes for Index 8.
at org.testSample3.example.ListClass.main(ListClass.java:28)