**Explanation**

The basic idea is to save all none-zero numbers in place in the front part, then fill 0 into the remaining part. No need to swap in this way. Any advice will be welcome!

```
public void moveZeroes(int[] nums) {
int p = 0;// Index of none-zero number
for (int i : nums)
if (i != 0)
nums[p++] = i;
while (p < nums.length) nums[p++] = 0;
}
```