public class Exercise2 { // replaces in a every occurrence of x by y public static void replace(int[] a, int x, int y) { for (int i=0; i