Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Java puts zeros that appear in integer arrays after them.
Java puts zeros that appear in integer arrays after them.
Because of the invariance of arrays, the array returned by changing the position of elements is actually a new array.

Public? Class? Test {

Public? Static electricity Invalid? Main (string ...? args){

int[]? Answer? =? {0,9,0,4,5,0,0, 1 1,2};

int? Count? =? 0;

for(int? Me? =? 0; I<a. Length; i++){

What if (a[i]? ! =? 0)

system . out . print(a[I]);

other

count++;

}

for(int? j? =? 0? ; J< count? ; ? j++){

system . out . print(0);

}

}

}