Keep it simple and follow the advice.

  public static int anysevens(int n)
  {
    if(n == 0) return false
    else if(n % 10 == 7) return true;
    else return anysevens(n/10);
  }

Note. A recursive function definition has an if statement so that it can have more than once case. It must have at least one case that does not use recursion. (This one has two cases that do not use recursion, one for n = 0 and one for the case where the rightmost digit is 7.) It has at least one case that does use recursion. A case that uses recursion calls the same function on a smaller value. For example, anysevens(n) calls anysevens(n/10), and n/10 is smaller than n.