Java program to reverse a given string without using in-built methods