Domanda di colloquio di ADP

What is the fastest way to reverse a string in Java and C?