title: Do local variables in shared method work like static variable in C?
body: <p>Will the list in this shared method keep its state throughout the life of the method? Or will a new list be created every time this method is called?</p>
  
  <pre><code>Protected Shared Function newResxNodes(ByVal newName As String, ByVal newValue As String, Optional ByVal newComment As String = "") As List(Of ResXDataNode)
  
      Dim newResxNodesList As List(Of ResXDataNode) = New List(Of ResXDataNode)
  
      Dim newResxNode As ResXDataNode = New ResXDataNode(newName, newValue)
      If newComment &lt;&gt; String.Empty Then
          newResxNode.Comment = newComment
      End If
  
      newResxNodesList.Add(newResxNode)
  
      Return newResxNodesList
  End Function
  </code></pre>