fork download
  1. import java.util.Arrays;
  2. import java.util.List;
  3.  
  4. class Teste {
  5. public static void main(String[] args) {
  6. List<Integer> lista = Arrays.asList(1, 2, 3, 4, 6);
  7. System.out.println(lista.contains(5)); // false
  8. System.out.println(lista.contains(4)); // true
  9. }
  10. }
Success #stdin #stdout 0.05s 4386816KB
stdin
Standard input is empty
stdout
false
true