Question: The frequency ( ) method is supposed to return the number of occurrences of target within the array. Identify the location of any errors. public
The frequency method is supposed to return the number of occurrences of target within the array. Identify the location of any errors.
public static int frequencyint nums, int target
int index;
int count ;
forindex ; index nums.length; index
ifnumsindex target
count;
return count;
Group of answer choices
The code has no errors
Only the method signature has an error
Only the method body has errors
Both the method signature and body have errors
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
