public void setSRC(int var)
{
if (src== null)
{
src = new int[1];
src[0] = var;
}
else
{
int i = 0;
int[] temp = null;
temp = new int[src.length];
temp = src;
i = temp.length;
src = new int[i+1];
for (int j =0; j < temp.length ; j++)
src[j] = temp[j];
src[i] = var;
}
}
I am looking to make this method generic or template method. Any sort of help is appreciated. Looking forward to it