public class Solution {

public void moveZeroes(int[] nums) {

```
int end=0;
int front=0;
while(end<nums.length && nums[end]!=0){
end++; //find the first position of zero;
}
front=end+1; //from the position of first zero, to swap the numbers.
while(front<nums.length){
if(nums[front]!=0){ //find the first non-zero number.
nums[end]=nums[front];
end++;
nums[front]=0;
}
front++;
}
}
```

}