Properties referencing their class
Given the following class example:
How do the Node properties work here? Do they create new instances of the class?
How do the Node properties work here? Do they create new instances of the class?
csharp
class Node
{
public Node LeftNode { get; set; }
public Node RightNode { get; set; }
public int Data { get; set; }
}null for reference types and 0 for ints0var root = new Node(0);
root.Left = new Node(1);
root.Right = new Noe(2);
root.Left.Left = new Node(3);