Reverse String In Java Using Function Loops