Okay, so I have this piece of code tested and I found there isn\'t any exception thrown out.
public static void main(String[] args) {
int[] list = {1,2}
You have specified in your IF statement that both of the conditions should be true for the System.out.println to be executed. So if the first condition itself fails,the second condition is not checked (this is for AND operator). But the second condition will be cheked if you have specified OR operator in the If statement.