I am going to assume that i is the number that needs to be tested for.

So...

In your code, make sure you check every number in the array by using j as the index for the array. Also, you should not create a again inside the method, as that would then remove the parameter passed to this object. I added a main method to make it easier to test the code. Running the example below, the output should be 3.