For this Question: Given an array A[] of size N containing non-negative integers. You have to move all 0's to the end of array while maintaining the relative order of the non-zero elements.

Note:
You must do this in-place without making a copy of the array.
Minimize the total number of operations.The first line of input line contains T, denoting the number of testcases. Each test cases contains 2 lines. First-line contains N, size of array. Second-line contains elements of array separated by space.

Constraints:
1 <= T <= 100
1 <= N <= 10^5
1 <= A[i] <= 10^5

<b>Sum of N over all testcases does not exceed 10^6</b>
For each testcase you need to print the updated array.Sample Input:
2
5
0 1 0 3 12
8
0 0 0 0 1 2 3 4

Sample Output:
1 3 12 0 0
1 2 3 4 0 0 0 0, I have written this Solution Code: 
import java.util.*;
import java.lang.*;
import java.io.*;

class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
	    int t;
	    t=sc.nextInt();
	    while(t-->0){
		int n=sc.nextInt();
		int a[] = new int[n];
		for(int i=0;i<n;i++){
		    a[i]=sc.nextInt();
		}
		int j=-1;
		for(int i=0;i<n;i++){
		    if(a[i]==0 && j==-1){
		        j=i;
		    }
		    if(j!=-1 && a[i]!=0){
		        a[j]=a[i];
		        a[i]=0;
		        j++;
		    }
		}
		for(int i=0;i<n;i++){
		    System.out.print(a[i]+" ");
		}
		System.out.println();
	    }
	

}	    


}, In this Programming Language: Java, Now tell me if this Code is compilable or not?