title: Displaying Array with JOptionPane
body: <p>First, this is a school activity, an activity that i cant solve by my own. </p>
  
  <p>i'm a first year college BSIT student and this my first post.</p>
  
  <p>i'm having trouble in displaying my "initialized array" in JOptionPane, i cant find the right code to display them. hope you get my question.</p>
  
  <p>heres my code..</p>
  
  <pre><code>public static void main(String[] args) {
  
          String display="";
  
          String size = JOptionPane.showInputDialog("Enter Your Prefered Size Of Your Array");
          int newsize = Integer.parseInt(size);
          JOptionPane.showMessageDialog(null,"You Entered "+newsize+".");
  
          String array[] = new String[newsize];
  
          for (int a=0; a&lt;array.length;a++)
          {
              JOptionPane.showInputDialog("Enter Value For Array["+a+"].");
          }
  
          for (int a=0;a&lt;array.length;a++)
          {
              display = display +array[a];
          }
  
          JOptionPane.showMessageDialog(null,"\n"+array[display]);
  
      }
  
  }
  </code></pre>