title: Returning Array contents instead of memory address
body: <p>So I'm trying to return the contents of an array in a method.
  Lets assume this array is called x and it already has values in it.</p>
  
  <pre><code>    public int[] returnArray()
       {
         return x;
        }
  </code></pre>
  
  <p>Now, I know that this will return the memory address of the array. So I tried this workaround I saw earlier:</p>
  
  <pre><code>    public int[] returnArray()
       {
        int[] y=new int[x.length]
         for (int i=0;i&lt;x.length;i++)
         {
           y[i]=x[i]
         }
         return y;
        }
  </code></pre>
  
  <p>Now, this is also returning the memory address of the array. Is there no workaround for this?</p>