I am trying to check "using"the list contains () method to check for a character present in the array. The code seems to run but returns false.why is that?
import java.util.Arrays;
public class charcontain
{
public static void main(String args[]) {
char arr[]={'2','a','g','4'};
System.out.println("4 in arr : "+ Arrays.asList(arr).contains('4'));
}
}
4 in arr : false