```
public class Solution {
public void moveZeroes(int[] nums) {
int i=0;
int j=0;
for(i=0;i<nums.length;i++){
if(nums[i]==0){
//hold j which point to the first 0
}
else{
int temp;
temp=nums[i]; //swith nums[i] and nums[j]
nums[i]=nums[j];
nums[j]=temp;
j++; //j move to next pos, which is still the first pos of 0
}
}
}
}
```