Microsoft
 Search
Monday, October 13, 2008 ..:: Community Forum ::.. Register  Login
 Community Forum Minimize
     
  .NET Development  MCTS 70-526 Study Group  Chapter 9, pg 459-460, VB vs C#  

 Chapter 9, pg 459-460, VB vs C# 
 
VisioMVP
3 posts
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#?
Flip
72 posts
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#
 
 
   

Search   

Copyright 2008 Ottawa .NET Community   Terms Of Use  Privacy Statement
Portal engine source code is copyright 2002-2008 by DotNetNuke. All Rights Reserved