283.移动零 使用双指针: class Solution {public void moveZeroes(int[] nums) {if(nums == null){return ;}int j = 0;for(int i = 0;i<nums.length;i++){//当前元素不为0时,就把其交换到左边,等于0的交换到右边if(nums[i] != 0){int tmp = nums[i];nums[i] = nums[j];nums[j++] = tmp;}}} }