Please use code tags, which make code easier to read. Please use ctrl-C and ctrl-V rather than writing code out; this will save you from little mistakes like "Public" for "public".
You have a base case, though I think maybe it would work better with 1 than with 0.
You have a reduction step.
You are calling your own method.
You will have to go through the whole method with a pencil and paper and work out what is happening. You will get something like this:
You go into the partition(int) methodThis calls the partitions(int, int, String) methodYou go into the partitions(int, int, String) methodIt starts by seeing whether n is zero.If it is zero it . . . .etc etc.As an alternative, see if you can get that method to run, get an
IDE and debug it with the step into, step over, and step return commands. Do it several times and inspect the variables and the method call stack (which is usually displayed somewhere) and watch what happens. I told you how to do that about a week ago.