Difference between VB.NET and C#. Which is faster ?
Answer Posted / umarali1981
C#:
1. In C#, variables are declared using declarators.
2. In C#, an object can only be created using new.
3. In C#, void is specified as the return type when a method
does not return a value.
4. In C#, no keyword is required to indicate an overloaded
method.
5. The current object is referred using this pointer in C#.
6.Non virtual call cannot be made in C#.
7.Compound data type is declared in C# using class, struct
and interface.
8. In C#, constructors are used to initialize an object.
9. Object cleanup can be explicitly done by destructor in C#.
10. In C#, an object is subject to asynchronous modification
using volatile keyword.
11. In C#, all the variables have to be declared before
being used.
12. In C#, default property is defined by using indexers.
13. In C#, base class can be referred using the keyword ‘base’.
14. Abstract class of C# can only be inherited and not
instantiated.
15. Sealed keyword of C# is used to denote that a class
cannot be inherited.
16. Division can be performed in C# using / operator.
17. Remainder of division can be retrieved using mod
operator of C#.
18. C# does not have exponentiation operator.
19. C# has Bitwise operators namely &,| and ^.
20. Object reference variables can be compared using ==
operator in C#.
21.The short ciruit operators in C# are && (Boolean AND) and
|| (Boolean OR).
VB.NET:
1.In VB.NET, the variables are declared using keywords such
as private, protected, friend, public, static, shared and Dim.
2.In VB.NET, an object can be created using new and
CreateObject().
3.In VB.NET, Sub is used in method declaration to indicate
that the method does not return any value.
4.In VB.NET, Overloads keyword is used to indicate an
overloaded method.
5.The current object is referred as me in VB.NET.
6.To make a non-virtual call to the current object’s virtual
method, MyClass is used in VB.NET.
7.Compound data type is declared in VB.NET using Structure.
8.In VB.NET, Sub New() is used to initialize the newly
created object.
9.Object cleanup can be done by using Finalize method in VB.NET.
10.In VB.NET, an object cannot be modified in an
asynchronous way.
11.In VB.NET, variables can be forced for explicit
declaration using Option Explicit.
12.In VB.NET, default property is defined using Default.
13.In VB.NET, base class can be referred using the keyword
‘MyBase’.
14.MustInherit keyword of VB.NET is used to denote that a
class can only be inherited and not instantiated.
15.NotInheritable keyword of VB.NET denotes that the class
cannot involve in inheritance.
16.Division can be performed in VB.NET using \ operator.
17.Remainder of division can be retrieved using %.
18.In VB.NET, exponentiation can be performed using ^ operator.
19.Bitwise operators in VB.NET are And, Or, Xor.
20.Object reference variables can be compared using Is
operator in VB.NET.
21.The short circuit operators in VB.NET are AndAlso
(Boolean AND) and OrElse (Boolean OR).
Reference:
http://onlydifferencefaqs.blogspot.in/2012/08/csharp-difference-faqs-1.html
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
How to view a .NET assembly?
Explain the purpose of Remoting in .NET?
What is an interface and what is an abstract class? Please, expand by examples of using both. Explain why?
What is equivalent for regsvr32 exe in .net ?
Is .net is a language?
Explain can 2 different applications use the same dll in gac at the same time?
Difference between value type & reference types ?
What tools can I use to develop .net applications?
Explain what is the difference between web application and enterprise application?
Explain the different parts of an assembly?
Explain me why do we use msmq?
When displaying fonts, what is the difference between pixels, points and ems?
What is .net technology?
What is namespaces in .net?
Can a try block have more than one catch block?