Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

void add method using collections

public void add(int index, int value)
    {
        checkIndex(index, 0, size);
        checkResize();
        for (int i = size; i > index; i--)
        {
            elementData[i] = elementData[i-1];
        }
        elementData[index] = value;
        size++;
    }
 
PREVIOUS NEXT
Tagged: #void #add #method #collections
ADD COMMENT
Topic
Name
5+2 =