title: How to pass parameter of a class based array-list in java.util program
body: <p>Can anyone help me to correct the  /* ... */ code i.e. the function static void display so as to get the passed arraylist as parameter and display it accordingly there, which I am getting error everytime. Please help me I am a novice in java program using util class</p>
  
  <hr>
  
  <pre><code>import java.util.ArrayList;
  
  public class test1{
  
      static void display(ArrayList&lt;Row&gt; arrayList1) 
      {
          ArrayList&lt;Row&gt; arrayList1 = new ArrayList&lt;&gt;();
          Row row;
       row = new Row(111,711,1110,111);
      //    rows.add(row);
       arrayList1.add(row);
      System.out.println(arrayList1); // passing the arraylist values and adding the element
  
   // Show the Array
  
          System.out.println("u\t v\t t\t lamda");
          System.out.println("------------------------------");
          for (Row printRow : rows)
          {
              System.out.println(
                      printRow.getu() + "\t " +
                      printRow.getv() + "\t" +
                      printRow.gett() + "\t" +
                      printRow.getlamda());
  
          }
  
      */
  
      }
  
  
  
      public static void main(String[] args)
      {
          ArrayList&lt;Row&gt; rows = new ArrayList&lt;&gt;();
          Row row;
  
          row = new Row(4,7,5,1);
          rows.add(row);
          row = new Row(3,6,6,1);
          rows.add(row);      
          row = new Row(5,9,6,1);
          rows.add(row);
          row = new Row(6,7,7,1);
          rows.add(row);
          row = new Row(6,9,7,1);
          rows.add(row);
  
          row = new Row(7,10,8,1);
          rows.add(row);
          row = new Row(7,10,9,1);
          rows.add(row);
          row = new Row(1,7,10,1);
          rows.add(row);
  
  
          // Show the Array
  
          System.out.println("u\t v\t t\t lamda");
          System.out.println("------------------------------");
          for (Row printRow : rows)
          {
              System.out.println(
                      printRow.getu() + "\t " +
                      printRow.getv() + "\t" +
                      printRow.gett() + "\t" +
                      printRow.getlamda());
  
          }
           display(rows);
  
      }/* 
  
  
  }
  </code></pre>
  
  <hr>
  
  <pre><code>class Row
  {
  
  
      private final int u;
      private final int v;
      private final int t;
      private final int lamda;
  
  
      public Row(int u, int v, int t, int lamda)
      {
          this.u = u;
          this.v = v;
          this.t = t;
          this.lamda = lamda;
      }
  
      public int getu()
      {
          return u;
      }
  
      public int getv()
      {
          return v;
      }
  
      public int gett()
      {
          return t;
      }
  
      public int getlamda()
      {
          return lamda;
      }
  
  
  }
  </code></pre>