title: How to display java bean objects in a container without using get() in a loop?
body: <p>I'm new to java. can you guide me on the below snippet. I have added 5 EmpBean objects to the ArrayList arr.  </p>
  
  <pre><code> List arr=new ArrayList();
      for(int i=0;i&lt;5;i++)
      {
          EmpBean eb=new EmpBean();
          eb.setFirstID(i);
          eb.setLastID(i);
          arr.add(eb);
      }
  </code></pre>
  
  <p>How do I display those 5 EmpBean objects in a single shot and not by using arr.get(0) and display individual EmpBean objects?</p>
  
  <p>please help,</p>
  
  <p>Thanks</p>