Can someone help me for convert this c# recursive function to java : <p>I have a c# function  and I want to translate my func to Java. But I'm making a mistake with this conversation and I cant figure it out.   Here is my C# code: </p>

<pre><code>public bool ParantezKontrol(string input, int numOpen = 0)
    {
        if (numOpen &lt; 0)
            return false;
        if (string.IsNullOrEmpty(input))
            return numOpen == 0;

        char c = input[0];
        string rest = input.Substring(1);
        if (c == '(')
            return ParantezKontrol(rest, numOpen + 1);
        else if (c == ')')
            return ParantezKontrol(rest, numOpen - 1);
        else
            return ParantezKontrol(rest, numOpen);
    }
</code></pre>

<p>I couldnt realise <code>ParantezKontrol(string input, int numOpen = 0)</code> this definition and <code>return numOpen == 0;</code> this . </p>

<p>And here what i wrote Java code: </p>

<pre><code>public boolean ParantezKontrol(String input, int numOpen){

    if(numOpen&lt;0)   //numOpen=-1 olması durumunda parantez kapatılmayı unutmuştur. Bu durumda fonksiyon false değer gönderir.
        return false;
    if(input==null&amp;&amp;input.isEmpty()){

        return  true;
    }
    char c= input.charAt(0);

    String rest = input.substring(1);

    if(c == '(')
        return ParantezKontrol(rest,numOpen+1); //Girilen metinde '(' varsa fonksiyonu sağdan çağır
    else if (c==')')
        return ParantezKontrol(rest,numOpen-1); // ')' varsa soldan çağır
    else return ParantezKontrol(rest,numOpen);

}
</code></pre>

<p>can someone explain me where i'm making mistake and solve my problem please </p>
