Java nested if statement, Then we're checking value of x with 30 using if statement