I have done the following but i have a problem with the recursive part
public class SumOfArray {
public static void main(String[] args)
{
int a[] ={2,4,5};
System.out.println(Array( a) );
}
public static int Array( int [] a)
{
if(a.length==1)
return a[0];
else
return a[a.length-1]+Array( a-[a.length-1] ) ;
}
}