Lio wrote:
I specified the error in my previous post
at java.util.ArrayList.RangeCheck(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at Test.main(Test.java:6)
Matthew wrote:
That's where the exception occurs, not what it was.
Lio wrote:
the exception occurs
System.out.println(inp.getArray().get(0));
Lio Liov wrote:Thanks
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
Lio Liov wrote:Thanks
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Lio Liov wrote:thanks
What shall I do
-in the main check if the object is created
Or I can prevent somehow object to be created
That is very bad practice, altering a post after it has been replied to.Lio Liov wrote:Yes I did ,you can see it in the code above . . .
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |