title: How to get the values of generic array in Java?
body: <p>I want to get the real value of a generic class member (an array) in Java. I have googled it for several hours but have not found a clear answer. Honestly, I'm new to Java and this generic stuff.</p>
  
  <pre><code>public class Box&lt;T&gt; {
      private T t;
  
      public Box(T t) { this.t = t; }
  
      public void getTheT() {
          // get the value of t at index 0
          System.out.println(this.t[0]); // this doesn't work
      }
  }
  
  public class App {
      public static void main(String[] args) {
          Integer[] Arr = {2,3,4};
          Box&lt;Integer[]&gt; i = new Box&lt;Integer[]&gt;(Arr);
          i.getTheT();
  
      }
  }
  </code></pre>
  
  <p>I've updated my question. Maybe this time it's clearer.
  How can I get the original value of <code>t</code>?</p>