title: How to use a method to a JOptionPane.showInputDialog in main with arrays?
body: <p>I have an assignment to create a program where I need a series of methods that are called from main which are passed arrays.</p>
  
  <p>I have 3 arrays.</p>
  
  <p>I need to create a program which should have the arrays declared in the main and passed as arguments to methods.</p>
  
  <p>All arrays should be passed as an argument to a method which asks for input.</p>
  
  <p>So basically 2 methods including main.</p>
  
  <p>Right now, my code looks a little like this, but it doesn't do what I need.</p>
  
  <pre><code>class testArrayMethod {
  
      public static void main(String [] params) {
  
              String[] array1 = {"Test1","Test2","Test3","Test4","Test5"};
              String[] array2 = {"1tseT","2tseT","3tseT","4tseT","5tseT"};
              int[] array3 = {5,10,15,20,25};
  
              JOptionPane.showMessageDialog(null, "Yes or No?");
              JOptionPane.showInputDialog(null, array_input(array1,array2,array3)); 
  
              System.exit(0);
      }
  
      public static String array_input(String[] a, String[] b, int[] c) {
  
              String q = "";
  
              for (int i=0; i&lt;a.length; i++) {
                      q += "Array 1: " + a[i] + "\n" + 
                           "Array 2: " + b[i] + "\n" + 
                           "Array 3: " + c[i] + "\n";
              }
  
              return q;
      }
  
  }
  </code></pre>
  
  <p>Right now it prints all of the array information on to a single InputDialog, but I need it to print to 5 different ones, I need some sort of different loop mechanism I guess? </p>
  
  <p>This is a university assignment so if you can somehow explain it to me without simply doing it I would really be glad, I want to understand and learn this.</p>