title: Convert code with pointers in C to Java code
body: <p>I am having some difficulty in understanding how to write the below piece of code using <code>String</code> or <code>char[]</code> in Java.</p>
  
  <pre><code>void xyz(char *a, int startIndex, int endIndex)
  {
     int j;
     for (j = startIndex; j &lt;= endIndex; j++)
     {
         doThis((a+startIndex), (a+j));
         xyz(a, startIndex+1, endIndex);
     }
  }
  </code></pre>
  
  <p>Here <code>char *a</code> points to the starting location of the <code>char name[]</code></p>
  
  <p>The above are just some random functions, but I just want the logic of how to use <code>char*</code> and character index <code>char[]</code> in Java</p>