public class ggg
{
static int y=0;
static int x;
static String h;
public static void main(String [] args)
{
    String s = "hadoyef";
    x = s.length();
    System.out.println(s);
    reverse(s);
    System.out.println(s);
}
public static String reverse(String s){
    if (s.length() == 1){
        //System.out.print(s);
        h = h + s.substring(0,1);
        s=h;
        System.out.println(s);
        return s;
    }
    else{
        h = h + s.substring(s.length()-1,s.length());
        return reverse (s.substring(0, s.length()-1));  
        //System.out.print(s.substring(0,1));
    }
}
}
Please help me I dont understand why the s=h; part isn't working. Ignore from here its making me post more detail and idk what to say so im just going to ramble until it works thanks for whoever helps.
 
     
     
     
     
    