java if true do this else do this code example Example: if and in java if(x == 1 && y == 2){ println("x = 1 and y = 2"); }