Here you can find the source of sum(short tab[], int a, int b)
static public int sum(short tab[], int a, int b)
//package com.java2s; // it under the terms of the GNU General Public License as published by // public class Main { static public int sum(short tab[], int a, int b) { int sum = 0; for (int i = a; i <= b; i++) { sum += tab[i];//w w w.ja v a 2 s .c o m } return sum; } static public float sum(float tab[], int a, int b) { float sum = 0; for (int i = a; i <= b; i++) { sum += tab[i]; } return sum; } }