title: How do I convert [[Ljava.lang.String;@7defb4fb] to a String
body: <p>I am trying to print the <code>String</code>, below is the code:</p>
  
  <pre><code>Object[] objArr = data.get(key);
  for (Object obj : objArr)
  {
      System.out.println(obj);
      cell.setValue(obj);
  }
  </code></pre>
  
  <p>but I get following output in the console:</p>
  
  <pre><code>[[Ljava.lang.String;@7defb4fb]
  </code></pre>
  
  <p>I have tried the following snippets:</p>
  
  <pre><code>System.out.println(Arrays.toString(objArr));
  System.out.println(Arrays.asList((objArr)));
  System.out.println(objArr[k]);
  </code></pre>
  
  <p>But all of these are giving similar strange output:</p>
  
  <pre><code>[[Ljava.lang.String;@7defb4fb]
  [[Ljava.lang.String;@7defb4fb]
  [Ljava.lang.String;@7defb4fb
  </code></pre>
  
  <p><strong>How do I get the string value out of it?</strong></p>
  
  <p>**</p>
  
  <blockquote>
    <p>Edit:</p>
  </blockquote>
  
  <p>**
  My problem was to print and array of an array in Java. First thing was to recognize that its nested arrays and hence when I try to iterate over the array and print its elements it was printing the address of the address instead of the element. </p>
  
  <blockquote>
    <p>[Ljava.lang.String;@7defb4fb]</p>
  </blockquote>
  
  <p>My problem was to recognize this as an array and iterate over this array again in order to print the elements. Hence here was the solution</p>
  
  <pre><code>if (obj instanceof String[]) {
          String[] strArray = (String[]) obj;
          System.out.println(Arrays.toString(strArray));
          // System.out.println(obj);
      }
  </code></pre>