> String reverse (String in)
> throws IOException
To the OP:
This is an example, bear in mind. In Real Life trap and log exceptions at the
point of occurrence, then perform a strategic recovery (possibly to exit the
app?).
> {
> Reader reader = new StringReader(in);
Note the good use of an interface variable type with a concrete implementation
run-time type. This is a best practice.
> Stack<Character> stack = new Stack();
Oops. "new Stack<Character>()".
> int ch;
The scope of "ch" is too wide. Put it into a for loop.
> while ((ch = reader.read()) != -1)
> {
> stack.push((char)ch);
> }
>
> Writer writer = new StringWriter();
This one cannot go into a for loop because the value is needed after the loop.
> while (!stack.isEmpty())
> {
[quoted text clipped - 5 lines]
> return reversed;
> }
There are ways that follow this pattern without using java.io, also.

Signature
Lew