
Hi, I am facing problem in adding/inserting an elemnts in array.
can any one please sahre the code for the same without using collection(Built in function)
Regards": Akash

hi friend,
you didn't posted your java code where you are facing problem in adding elements into an array.
In Java array, value can't be added to the array because the size of array is fixed when it is created. For the variable size of array you would be required to implement the List as ArrayList of java.util.Collection
Or, Perhaps you are looking like this, hope this will helpful for you.
public class AddElement
{
public static void main(String args[])
{
int num = 0;
int lastNum = 10;
int[] numArray = new int[lastNum];
for(int i = 0; i < numArray.length; i++)
{
numArray[i] = num;
num++;
System.out.print(numArray[i] + " ");
}
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.