Here you can find the source of subtract(int[] a, int[] b)
public static final int[] subtract(int[] a, int[] b)
//package com.java2s; //License from project: Apache License public class Main { public static final int[] subtract(int[] a, int[] b) { int[] c = new int[a.length]; for (int i = 0; i < a.length; i++) { c[i] = a[i] - b[i];//from w ww . j av a 2s . com } return c; } public static final long[] subtract(long[] a, long[] b) { long[] c = new long[a.length]; for (int i = 0; i < a.length; i++) { c[i] = a[i] - b[i]; } return c; } public static final float[] subtract(float[] a, float[] b) { float[] c = new float[a.length]; for (int i = 0; i < a.length; i++) { c[i] = a[i] - b[i]; } return c; } public static final double[] subtract(double[] a, double[] b) { double[] c = new double[a.length]; for (int i = 0; i < a.length; i++) { c[i] = a[i] - b[i]; } return c; } }