Open In App

Difference Between VB.NET and C#

Last Updated : 29 Jan, 2022
Comments
Improve
Suggest changes
Like Article
Like
Report

Visual Basic .NET is a high-level programming language that was initially developed in 1991. It was the first programming language that directly supported programming graphical user interfaces using language-supplied objects. It supports all the concepts of an object-oriented such as object, class, encapsulation, etc.

C# is commonly pronounced as C-sharp. It is the object-oriented programming language that is run on the .NET framework. This language is developed by Microsoft. Various kinds of applications can be easily created by using this language. For example Mobile applications and game development.

Difference between VB.NET and C#:

BasisVB.NETC#
PronunciationIt is pronounced as Visual Basic  .NET.It is pronounced as C-Sharp.
BelongingIt is an updated version of Classic Visual Basic 6.0.It belongs to the C family and it is evolved from C.
Variable DeclarationVariables are declared using keywords such as Private, Protected, Friend and Static, etc.Variables are declared using declarations.
Object CreationThe object is created using New and Create Object().The object can be created using New.
Object InitializationIn this, Sub New() is used to initialize, uses a newly created object.In this, constructors are used to initialize the object.
Class Declaration In VB.NET declare a class by using Class <implementation> keyword.In C# declare a class by using the Class keyword.
Hiding This feature will not be supported in VB. NET.This feature is supported by C#.
Default PropertyIt is defined by using Default.It is defined by using Indexer.
Overloading FunctionIn VB.NET for Overload a function or method Overloads keyword is used.In C# for Overload a function or method no language keyword is required for this purpose.
Exponential OperatorIt uses the 'this' operator.It does not use the 'this' operator.
Base ClassIn VB.NET refer to a base class by using the MyBase keyword.In C# refer to a base class by using the base keyword.
Object CleanIt is done by Finalize Method.It is done explicitly by  Destructor.
ImplementationIt follows the Inheritance model.The basic interface is done by sing class or structure.
Error HandlingIt supports both structured and unstructured error handling.It supports only structured error handling.
Case SensitivityIt is case insensitiveIt is case-sensitive.
ShadowingThis feature is supported in VB.NET.This feature is not supported in C#.
Termination of statementA semicolon is not used.A Semicolon is used.
UsageBasically used for the development of Microsoft-based applications.Basically used for the development of desktop-based applications.

Next Article
Article Tags :

Similar Reads