feat: add "while-not-null" test
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user