java check if String contains value of arraylist code example Example: java arraylist contains string boolean ans = arr.contains("geeks");