// http://codingbat.com/prob/p132134

public boolean in3050(int a, int b) {
  return ((a >= 30 && a <= 40 && b >= 30 && b <= 40) ||
          (a >= 40 && a <= 50 && b >= 40 && b <= 50));
}

Create in3050.java