• + 0 comments

    Can someone explain to me while the following code only returns zeroes (JAVA):

    public int computeDifference(){ Arrays.sort(elements); int len = elements.length-1;

        int maximumDifference = Math.abs(elements[0] - elements[len]);
        return maximumDifference;
    }