29 lines
320 B
Plaintext
29 lines
320 B
Plaintext
class Some {
|
|
Some next;
|
|
}
|
|
|
|
Some l4 = new Some;
|
|
|
|
Some l3 = new Some;
|
|
l3.next = l4;
|
|
|
|
Some l2 = new Some;
|
|
l2.next = l3;
|
|
|
|
Some l1 = new Some;
|
|
l1.next = l2;
|
|
|
|
Some root = new Some;
|
|
root.next = l1;
|
|
|
|
Some obj = root;
|
|
while (obj != null)
|
|
{
|
|
obj = obj.next;
|
|
printline("Now object is:");
|
|
printline(obj);
|
|
}
|
|
|
|
printline(obj);
|
|
|