Hello fellows.. In the second method "searchArray2" it shows me an error on "return false", which says that it's incompatible types.. I know that it's about mixing string and int, but what if I want my array to be int, how can I return true if the value is found, false otherwise.
Thank you
public class RecursiveCalculator { public int searchArray(int[] array, int value){ if (value != array.length) return value; else return -1; } public String searchArray2(String[] array, String value){ if (value != array.length) return false; else return true; } public String reverseString(String reverse){ if (reverse.length() == 0) return reverse; return reverseString(reverse.substring(1)) + reverse.charAt(0); } }