The contains() method can be used to check if a Java ArrayList contains a given item or not if (lista.contains(conta1)) { System.out.println("Account found"); } else { System.out.println("Account not found"); }