title: Equivalent of C's pointer to pointer in Java
body: <p>I am unable to pass <strong>pointer to pointer</strong> as an argument to the function in Java.I know that Java don't have pointers instead we pass reference to objects. I want to know how this is done. 
  To clear my doubt I am pasting the code snippet of the program that I am implementing. </p>
  
  <p>In the following program I am calling a method "Partition" from the method "QuickSortRecur".
  As I work on C for most of the time I don't know how to send the parameters <strong>newHead</strong> and <strong>newEnd</strong> as <strong>pointer to pointer</strong>. </p>
  
  <p>I have also mentioned the C Equivalent of the below lines , I just want to know how can I implement the same in Java?</p>
  
  <p>Java : </p>
  
  <pre><code>public ListNode Partition(ListNode lhead,ListNode lend,ListNode newHead,ListNode newEnd){
           ---------
           ---------
           ---------
  
      }
  public ListNode QuickSortRecur(ListNode lhead,ListNode lend){
      ListNode newHead=null;
      ListNode newEnd=null;
      ListNode pivot;     
  
      pivot=Partition(lhead,lend,newHead,newEnd);
      if(newHead==null)
              {
              System.out.println("This is not updated ");
              }
         }
  </code></pre>
  
  <p>C Equivalent of Above Signature: </p>
  
  <pre><code>struct node *partition(struct node *head, struct node *end,
                         struct node **newHead, struct node **newEnd){
  }
  
  struct node *quickSortRecur(struct node *head, struct node *end)
  {
  struct node *pivot = partition(head, end, &amp;newHead, &amp;newEnd);
  }
  </code></pre>