Question: When I test my add method for the ArrayStringList with one element, it shows 2 . For example, when I add ( 0 ,
When I test my add method for the ArrayStringList with one element, it shows For example, when I adda the list looks like a a What could be the bug? The javadoc API says: Inserts an item into this string list at the specified index position. If an item was already at that position, then that item and subsequent items are shifted to the right ie one is added to their indices It throws a NullPointerException if item is null, an IllegalArgumentException if item is empty, and an IndexOutOfBoundsException if index is out of range index index size
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
