java pass by value example help me to understand
<p>I have the following code </p>

<pre><code>class sample
{

  public void update(List l)
  {
      l = null;
  }

  public static void main (String[] args)
  {

      List m = new ArrayList();
      m.add("suresh");
      m.add("sankar");
      new sample().update(m);
      System.out.println(m);
  }
}
</code></pre>

<p>The answer will be {["suresh,"sankar"]}. The <code>m</code> is a pointer to the arraylist object, it contains an memory address value (for ex consider 0xf34 ). when we pass m to update method ,the local variable l will be set to  0xf34 that points to  arraylist object  in memory .when we set  null to this variable l , the memory address replaces the arraylist with null ,hence the variable m should also refer null.am i right.please help.</p>
