arrays - int cannot be converted to int[] -
i'm counting of specific numbers in array keep receiving error int cannot converted int[].
the variables val , two have been defined in program before, not error.
public static int[] removeval(int[] two, int val) { int count=0; (int a=0; a<two.length; a++) { if (two[a]==val) count++; } return count; }
the method returns array of ints, returning int, not array of ints.
Comments
Post a Comment