if and in java

Java
if(x == 1 && y == 2){
  println("x = 1 and y = 2");
}
Source

Also in Java: