Differences between C # and VB.NET

zhaozj2021-02-08  266

It is said that in .NET, .NET Framework and CLR are the basis for the application run. So, VB.NET and C # are exactly the same, just different grammar? Please see the information I have finished.

First, c #

--- Simple as VB, like a new language like C

C # is the first-line component-oriented language by Turbo Pascal, Delphi, And Visual J , the chief designer Anders Hejlsberg. Base class library is written by C #

Second, VB.NET

--- Basic language fully faced

1. New language features fully faced object-inheritance, overloading, shared member, structured exception handling strong language - strict type inspection, variable declaration initialization, support garbage collection power - Support for delegates, free threading, Variant data types are replaced by Object 2. Syntax consistent with VB6

Third, 2 differences?

Syntax difference

For example, looping

VB.NET

For i = 1 to 10 'for loopnext i

C #

For (i = 1; i <11; i ) {// for loop}

In addition, Visual Basic is not sensitive to case, while C # is sensitive.

2.C # has the characteristics of Visual Basic

Pointer, shift operator, embedded document (XML) overload operator

3. Visual Basic has but C # does not have characteristics

More richer grammar: events, try ... catch, select ... case, implementing the later binding, dynamic array, module, optional parameter, parameterization properties, background compilation

转载请注明原文地址:https://www.9cbs.com/read-955.html

New Post(0)