2019-09-12 10:33:56 -07:00
|
|
|
public program()
|
|
|
|
|
{
|
|
|
|
|
var stack := new system'collections'Stack();
|
2016-12-05 22:15:40 +01:00
|
|
|
|
2019-09-12 10:33:56 -07:00
|
|
|
stack.push:2;
|
2016-12-05 22:15:40 +01:00
|
|
|
|
2019-09-12 10:33:56 -07:00
|
|
|
var isEmpty := stack.Length == 0;
|
2016-12-05 22:15:40 +01:00
|
|
|
|
2019-09-12 10:33:56 -07:00
|
|
|
var item := stack.peek(); // Peek without Popping.
|
2016-12-05 22:15:40 +01:00
|
|
|
|
2019-09-12 10:33:56 -07:00
|
|
|
item := stack.pop()
|
|
|
|
|
}
|