I need to make a code that will count all the instances of 1 number in an array. Here is what I have so far:
public class NumOccurrences
public static int num (int a,int i)
int count = 0;
a = new int ;
for (int j = 0; j < a.length; j++ )
if (a == j)
2 out of my 5 tests pass, and I'm not sure what I am doing wrong, can someone point me in the right direction?