VB.NET 和 C# 的区别
Visual Basic .NET 是一种高级编程语言,最初于 1991 年开发。它是第一种直接支持使用语言提供的对象对图形用户界面进行编程的编程语言。它支持面向对象的所有概念,例如对象、类、封装等。
C# 通常发音为 C-sharp。它是在 .NET 框架上运行的面向对象的编程语言。该语言由 Microsoft 开发。使用这种语言可以轻松创建各种应用程序。例如移动应用程序和游戏开发。
VB.NET 和 C# 的区别:
Basis | VB.NET | C# |
---|---|---|
Pronunciation | It is pronounced as Visual Basic .NET. | It is pronounced as C-Sharp. |
Belonging | It is an updated version of Classic Visual Basic 6.0. | It belongs to the C family and it is evolved from C. |
Variable Declaration | Variables are declared using keywords such as Private, Protected, Friend and Static, etc. | Variables are declared using declarations. |
Object Creation | The object is created using New and Create Object(). | The object can be created using New. |
Object Initialization | In 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 | 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 Property | It is defined by using Default. | It is defined by using Indexer. |
Overloading Function | In 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 Operator | It uses the ‘this’ operator. | It does not use the ‘this’ operator. |
Base Class | In 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 Clean | It is done by Finalize Method. | It is done explicitly by Destructor. |
Implementation | It follows the Inheritance model. | The basic interface is done by sing class or structure. |
Error Handling | It supports both structured and unstructured error handling. | It supports only structured error handling. |
Case Sensitivity | It is case insensitive | It is case-sensitive. |
Shadowing | This feature is supported in VB.NET. | This feature is not supported in C#. |
Termination of statement | A semicolon is not used. | A Semicolon is used. |
Usage | Basically used for the development of Microsoft-based applications. | Basically used for the development of desktop-based applications. |