我正在编写一个public static方法howMany,它将ints(nums)和int(value)数组作为参数,并返回int(计数)value发生的次数nums.
我的代码:
public static int howMany(int[] nums, int value)
{
int count = 0;
for (int i = 0; i < nums.length; i++)
{
if (nums[i] == value);
{
count++;
}
}
return count;
}
Run Code Online (Sandbox Code Playgroud)
[代码无法正常工作.]我查看了我的代码,我不知道问题是什么.