Linked List representation through JAVA.

class Element
{
Element next;
int num;
public Element(int val)
{
next = null;
num = val;
}
}
class LinkList
{
private Element head = null;
public void append(int val)
{
Element lastElement = null;
//code for retrive last node
if(head == null)
lastElement = null;
else
{
Element tmp = head;
while(tmp.next != null)
{
tmp = tmp.next;
}
lastElement = tmp;
}
//add next element
if(lastElement == null)
head = new Element(val);
else
lastElement.next = new Element(val);

}
public void printList()
{
System.out.println(“”);
if(head != null)
{
Element tmpElement = head;
while(tmpElement.next != null)
{
System.out.print(tmpElement.num+”->”);
tmpElement = tmpElement.next;
}

}

}
public static void main(String[] args)
{
LinkList ll = new LinkList();
ll.append(1);
ll.append(2);
ll.append(3);
ll.append(4);
ll.append(5);
ll.append(6);
ll.append(7);
ll.append(8);
ll.append(9);
ll.append(10);
ll.printList();
}
}

Link to compiled source

http://ideone.com/eV4TUO