Java examples for Collection Framework:Array Algorithm
sum array with offset index
//package com.java2s; public class Main { public static double sum(double[] input, int offset, int len) { double sum = 0; for (int i = offset; i < offset + len; i++) { sum += input[i];/*from w ww .j a v a 2s . co m*/ } return sum; } }