import java.util.ArrayList;
public class Test {
public static void main (String[] args){
ArrayList<String[]> a = new ArrayList<String[]>();
a.add(new String[]{"one", "abc"});
a.add(new String[]{"two", "def"});
if(a.contains(new String[]{"one", "abc"})){
System.out.println(true);
}else{
System.out.println(false);
}
}
}
Console said "false." I have an ArrayList and I can't check whether it contains a particular String array. How to do and why?