title: How can I print an array in JOptionPane?
body: <p>For example, I have an array of type int and size 3, it has elements 1, 2, 3  When I try to print it in <code>JOptionPane</code> with loops, it makes three different panes.</p>
  
  <p>When I try:</p>
  
  <pre><code>JOptionPane.showMessageDialog( null, array );
  </code></pre>
  
  <p>It gives garbage values.</p>
  
  <p>I have searched everywhere but I couldn't find a solution.  How do I display the array in an option pane?</p>