Keep it simple and follow the advice.

  public static int sum(int n)
  {
    if(n == 1) return 1;
    else return sum(n-1) + n;
  }

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 does not use recursion in the case where n = 1.) 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, sum(n) calls sum(n-1), and n-1 is smaller than n.