Question: plz solve in java We have written a method called sun with an int[] parameter nums. We want our sum method to compute the sum

 plz solve in java We have written a method called sun
plz solve in java

We have written a method called sun with an int[] parameter nums. We want our sum method to compute the sum of nums, but our code has a bug (or perhaps bugs?) in it. TASK: Fix the bug(s) Sample Input: 1 2 3 4 5 Sample Output: 15 Write a program, test using stdin - stdout Time limit: 8 seconds Memory limit: 256 MB 1 static int sum(int[] nuns) { 2 int total -e; 3 for(int num : nums) { // for-each loop total + num; 1 point per submission Submit

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!