@@ -0,0 +1,523 @@
+import java.util.Arrays;%0A%0Apublic class RemoveElement %7B%0A    public int removeElement(int%5B%5D nums, int val) %7B%0A        int index = 0;%0A        for (int n : nums) %7B%0A            if (n != val) %0A                nums%5Bindex++%5D = n;%0A        %7D%0A        return index;%0A    %7D%0A    %0A    public static void main (String%5B%5D args) %7B%0A        RemoveElement test = new RemoveElement ();%0A        int%5B%5D nums1 = %7B1, 2, 1, 1, 3, 4%7D;%0A        System.out.println (test.removeElement(nums1, 1));%0A        System.out.println (Arrays.toString (nums1));%0A    %7D%0A%7D

Remove all occurrences of given number from array