Is this possible and if so how would I do this correctly? Want to be able to check if it contains 1 and 2 and if so go on with the program.
import java.util.*;
public class test
{
public static void main(String [] args) {
int[] field = {1, 2};
if (Arrays.asList(field).contains(1) && Arrays.asList(field).contains(2)) {
System.out.println("Hello World!");
}
}
}