error in my code on return statement
<p>I am getting error of return statement at line 16.</p>

<p>How can this be fixed?</p>

<pre><code>import java.util.Scanner;
class abc 
{
    String str;
     Scanner sc=new Scanner(System.in);
    int mid(int l,int h)
    {
         System.out.println((l+h)/2);
        str=sc.nextLine();
        if(str.indexOf('L')==0)
            mid(((l+h)/2+1),h);
        else if(str.indexOf('H')==0)
            mid(l,((l+h)/2)-1);
        else if(str.indexOf('w')==0)
           return 1;
    }


}
public class Main {
    public static void main(String[] args){
     int a,b;
     abc o;
     Scanner in=new Scanner(System.in);
     a=in.nextInt();
     b=in.nextInt();
     o.mid(a,b);
    }
}
</code></pre>
