2011年9月7日星期三

把null variable放進stack會怎樣?

Dim value1 As String = "hi"
Dim value2 As String = Nothing
Dim _queue As New Stack(Of String)
_queue.Push(value1)
_queue.Push(value2)
Console.WriteLine(_queue.Count)
Console.WriteLine(_queue.Pop)
結果: 2

很有趣的特性

沒有留言:

發佈留言