📜  VB.NET 和 C# 的区别

📅  最后修改于: 2022-05-13 01:55:44.709000             🧑  作者: Mango

VB.NET 和 C# 的区别

Visual Basic .NET 是一种高级编程语言,最初于 1991 年开发。它是第一种直接支持使用语言提供的对象对图形用户界面进行编程的编程语言。它支持面向对象的所有概念,例如对象、类、封装等。

C# 通常发音为 C-sharp。它是在 .NET 框架上运行的面向对象的编程语言。该语言由 Microsoft 开发。使用这种语言可以轻松创建各种应用程序。例如移动应用程序和游戏开发。

VB.NET 和 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 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.