How to print data which is inserted into linked list using linkedlist library of java
<pre><code>class Collection 
{ 
    int sNo; 
    String sessionID; 
    int noOfDependency; 
    int noOfRejection; 
    int totalValue;

    Collection(int sNo, String sessionID, int noOfDependency, int noOfRejection, int totalValue)
    {
        this.sNo = sNo;
        this.sessionID = sessionID;
        this.noOfDependency = noOfDependency;
        this.noOfRejection = noOfRejection;
        this.totalValue = totalValue;
    }
}

public class DependencyStack {

    /** Creates a new instance of DependencyStack */

    public DependencyStack() 
    {
        LinkedList lList = new LinkedList();
        lList.add(new Collection(1,"a",0,0,0);
        lList.add(new Collection(2,"b",0,0,0));

        for(int i=0;i&lt;lList.size();i++);
            System.out.println(lList.getFirst());
    }
</code></pre>

<p>I am not able to view the individual data. For e.g. if i want to view all sno "serial nos.", how can i do that.. i have tried lot of options, please helpp...</p>
