```
public void moveZeroes(int[] nums) {
int zeros = 0;
for(int i=0; i<nums.length; i++) {
int val = nums[i];
if(val == 0) {
zeros++;
} else {
nums[i] = 0;
nums[i - zeros] = val;
}
}
}
```