My implementation of dynamic array
In almost all methods for example in this one instead of 

public void removeElement(T element)
{
    int index=searchElement(element);
    if(index&gt;0)
    {
        removeElementAtIndex(index);
    }
}


should be

public void removeElement(T element)
{
    int index=searchElement(element);
    if(index &gt;= 0)
    {
        removeElementAtIndex(index);
    }
}


Because otherwise the first element will get you an error.