Mohd Fifi

Greenhorn
+ Follow
since Nov 11, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mohd Fifi

but how can i copy the array and provide a shorter one i have no idea abouut this
Would you please give an example on that

thanks
Mohd
17 years ago
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] ) ;

}
}
17 years ago
Write a recursive method to find the sum of the elements in array
17 years ago