Here you can find the source of negate(int[] ar)
public static int[] negate(int[] ar)
//package com.java2s; //License from project: Open Source License public class Main { public static int[] negate(int[] ar) { int[] negated = new int[ar.length]; for (int i = 0; i < ar.length; i++) negated[i] = -ar[i];/*from ww w. j a v a 2 s .co m*/ return negated; } }