int j = 0;int count = 0; //Set this variable to the number of times the 'remove' item appears in the listint[] array2 = new int[array.length - count];int remove = 6;for(int i=0; i < array.length; i++){ if(array[i] != remove) array2[j++] = array[i];}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)