Hi..
What is the Difference between c# and vb??...
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
MuthuMari MRank #5,738 · 288 reputationPosted Apr 25, 2012, 4:03 AM EDT
Hiding: – This is a C# Concept by which you can provide a new implementation for the base class member without overriding the member. You can hide a base class member in the derived class by using the keyword "new". The method signature, access level and return type of the hidden member has to be same as the base class member. Comparing the two:-
1) The access level, signature and the return type can only be changed when you are shadowing with VB.NET. Hiding and overriding demands these parameters as same.
2) The difference lies when you call the derived class object with a base class variable. In class of overriding although you assign a derived class object to base class variable it will call the derived class function. In case of shadowing or hiding the base class function will be called.
For Example:
Dim y As Integer = 5Dim z As Integer
z = Add(y) //This will set both Y and Z to 6.
z = Add((y)) //This will set Z to 6 but Value of Y will not be change, as we have included extra parenthese while calling.
The Add function:
Public Function Add(ByRef x As Integer) As Integerx = x + 1
Return x
End Function
thanks.
Satyapriya NayakRank #47 · 31.5K reputationPosted Apr 25, 2012, 4:47 AM EDT
Please refer the below links
http://www.codeproject.com/Articles/9978/Complete-Comparison-for-VB-NET-and-C
http://www.dotnetfunda.com/articles/article601-difference-between-csharp-and-vbnet.aspx
Thanks
SenthilkumarRank #387 · 6.5K reputationPosted Apr 26, 2012, 2:15 AM EDT
There are plenty of article which talks about the difference between these two.
http://www.codeproject.com/Articles/9978/Complete-Comparison-for-VB-NET-and-C
http://support.microsoft.com/kb/308470
http://www.dotnetexpertguide.com/2010/02/differences-between-vbnet-and-cnet.html
http://www.harding.edu/fmccown/vbnet_csharp_comparison.html
http://deliciousdotnet.blogspot.com/2011/02/differences-between-vbnet-and-cnet.html
VulpesRank #55 · 29.2K reputationPosted Apr 26, 2012, 5:08 AM EDT
When the latest versions (C# 5.0 and VB 11) come on stream later this year, the only difference worth mentioning IMO is that C# supports the use of pointers in unsafe code but VB does not.
Moreover, both languages are to be evolved in parallel in future - if one language gets a major new feature, then the other one will get it as well.