The point of recursion is that a method calls itself. To work properly, there
need to be two parts to the method - one part is the stop condition, which
ends the recursion, and the other part is the continue condition, which
invokes the method itself recursively. Think of when the recursive method has
to stop - code that part first. Then code the other part, thinking of what
work the recursed call has to do, what work the non-recursed code has to do,
and in which order the recursed and non-recursed code has to execute.
Here's one approach, completely untested, not even compiled, and not by any
means the only way:
public void reverse( BufferedReader in, BufferedWriter out )
String line = in.readLine();
if ( line != null )
reverse( in, out );
out.write( line );
Don't forget to flush.
Your thought to use String is entirely valid. Just think carefully about how
you'd put lines into a String in backwards order. rossum's advice to think of
how you'd do it in a loop might help. Recursive and looped algorithms both
involve repeating a part of the action.
Get out of the habit of writing everything as static methods.