title: i am able to save data in my arraylist but cannot print by another method
body: <p>when i call my print  method from my GUI class passing parameter in print method
  my print method declared in another class is able to store those value but when i try to print those value through print method then empty space is print``</p>
  
  <pre><code>import java.util.ArrayList;
  
  public class StudentInfo {
      ArrayList&lt;String&gt; arrayOfNames = new ArrayList&lt;&gt;();
      ArrayList&lt;String&gt; section = new ArrayList&lt;&gt;();
      ArrayList&lt;Integer&gt; marks = new ArrayList&lt;&gt;();
      ArrayList&lt;Long&gt; mobileNumber = new ArrayList&lt;&gt;();
  
      public void data(String s, String s1, long s2, int s3) {
          System.out.println(" " + s + " " + s1 + " " + s2 + " " + s3);
          arrayOfNames.add(s);
          section.add(s1);
          marks.add(s3);
          mobileNumber.add(s2);
          System.out.println("\nhi");
  
          System.out.println(arrayOfNames);
      }
  
      public void print() {
          System.out.println("\n\n hi");
          System.out.println(arrayOfNames);
          System.out.println(section);
          System.out.println(marks);
          System.out.println(mobileNumber);
      }
  }
  </code></pre>