Hey can anyone help me by telling how to delete the data an array which is inside another array.
eg: alpha[] is an array which has two arrays inside it of length [1-100] and [101-200] now i need to delete only the first array from alpha[].
Arrays are fixed in size, you cannot resize them after creating them. You can remove an existing item by setting it to null:
alpha[0]=null
Check out the Arrays utility class here.
If you are interested in just getting a sub array out of an array a good way to do that is Arrays.copyOfRange(alpha, 101, 200).
If you have a two dimensional array and you are only interested in one of the "rows" you can do Arrays.copyOf(alpha[1], alpha[1].length)
You can try either of these approaches:
int[] array = {1,2,3,4,5};
int[] subArray = new int[2];
System.arraycopy(array, 0, subArray, 0, 2);
System.out.println(Arrays.toString(subArray));
=> output: 1,2
subArray = Arrays.copyOf(array, 2);
System.out.println(Arrays.toString(subArray));
=> output: 1,2
alpha[0]=null? But what do you mean withlength [1-100]? Maybe you should show more code so that the context is clearer.