title: Call Overloaded Function in Java?
body: <p>How can I call the array function in Java?</p>
  
  <p>Currently it looks like:</p>
  
  <pre><code>public static void WriteLine(Object Array[]) {
      for (int I = 0; I &lt; Array.length; ++I) {
          Out.println(Array[I]);
      }
  }
  
  public static void WriteLine(Object Text) {
      Out.println(Text);
  }
  </code></pre>
  
  <p>I also tried:</p>
  
  <pre><code>public static &lt;T&gt; void WriteLine(T Array[]) {
      for (int I = 0; I &lt; Array.length; ++I) {
          Out.println(Array[I]);
      }
  }
  </code></pre>
  
  <p>and in my main, I do:</p>
  
  <pre><code>int[] I = new int[]{1, 2, 3, 4, 5};
  WriteLine(I);
  </code></pre>
  
  <p>I also tried:</p>
  
  <pre><code>WriteLine&lt;int[]&gt;(I);
  </code></pre>
  
  <p>Doesn't work..</p>
  
  <p>It prints:
  [I@2f56f920</p>
  
  <p>aka the address of the int Array. How can I call the specific array function explicitly or how can I make the compiler know which one to call automatically (implicitly)?</p>
  
  <p>I'm not used to Java/Generics/Object yet.. Just moved from C++ and used to templates :(</p>