`import java.util.Arrays; public class ListOperation { public static void main(String[] args) { int[] arr={1,13,45,5,0,0,16,6,0,25,4,17,6,7,0,15}; int[] b=delZero(arr); for(int m:b) System.out.println(m); }
static int[] delZero(int[] a)
{
int j=0;
for(int i=0; i<a.length;i++)
{
if(a[i]==0)j++;
}
int[] b = new int[a.length-j];
j=0;
for(int i=0; i<a.length;i++)
{
if(a[i] != 0)
{
b[j]=a[i];
j++;
}
}
return b;
}
}`