Domanda di colloquio di Infogain

Write a Java program to move all non-zero elements of the array to the end while maintaining their relative order, and set the remaining positions to 0.