title: Arraylist as parameter in method and add data in multiple Arraylist
body: <p>I have a java-programme:</p>
  
  <pre><code>    public class Faculty 
      {
      String facultyName;
      Double gemavailable; 
      }
  
      public class Session
     {
      String coursename;
      float noofhours;
      ArrayList&lt;Faculty&gt; faculty=new ArrayList&lt;&gt;();
      }
  
      public class TrainingInstitute 
     {
     ArrayList&lt;Faculty&gt; faculty=new ArrayList&lt;&gt;();
     ArrayList&lt;Session&gt; session=new ArrayList&lt;&gt;();
  
     public void takeASession(String coursename,float hours,ArrayList&lt;Faculty&gt; faculty)
     {
      Session s=new Session(coursename, hours, faculty);
      session.add(s);
     }
  </code></pre>
  
  <p>And I have the main class which looks like:</p>
  
  <pre><code>    public class TrainingController 
      {
  
      public static void main(String[] args) 
      {
          TrainingInstitute t=new TrainingInstitute();
  
          t.takeASession("java", 5,f1);
      }
  </code></pre>
  
  <p>My main motive is to create a session object by setting the course name,faculty who had taken the course and duration of the course.And the session object is added to the sessionTaken list of Training Institute.
  How would i do that ?</p>