|
|
| | |
Chapter 9, pg 459-460, VB vs C# Posted: 25 Oct 07 5:04 AM (Canada) |
| | |
The declarations between the VB and the C# examples have me a bit confused. The VB is: Dim aNode As TreeNode Dim bNode As TreeNode Dim ParentNode As TreeNode
while the C# is more elaborate: TreeNode aNode = new TreeNode(); TreeNode bNode; TreeNode parentNode = new TreeNode();
Why is bNode different in C#? |
| |
| | |
Re: Chapter 9, pg 459-460, VB vs C# Posted: 29 Oct 07 1:59 PM (Canada) |
| | |
Actually if I understand properly, both pieces some issues that are different. In the VB.NET code, the aNode and bNode are declared, but they are not initialized to anything, unlike the aNode in C# code which initialized to a new TreeNode. Actually, none of the variables in the VB.NET code are initialized, just declared.
I would expect to get some compiler warnings with the C# code about bNode not being inialized. |
| |
| | .NET Development MCTS 70-526 Study Group Chapter 9, pg 459-460, VB vs C# | | |
| | | |