Vb. NET vs C # syntax differences Show

Source: Internet
Author: User

After learning vb.net found that the vb.net and C # Grammar main differences in two parts, the two parts straightened out, then the ease of doing it. The comparison is summarized as follows:

I. Entity PARTS

(Compared to VB, in C # and vb.net, the use of entities is very innovative, as the first comparison rendered)

C # entity: The syntax format is

        Way public        int ID         {             get {return ID;}            set {ID = value;}                }        Way public        int ID {get; set;}

Vb. NET entity : The syntax format is

    Private Stucardid As String     ' defines static properties public property    CardID () As String        Get            Return stucardid        ' Function: Gets the property value        end Get        set (value as String)            Stucardid = value       ' function: Set property value        End Set    End properties

Second, method (function)

C # Method: The syntax format is

Syntax: Access limiter return value type method name (argument [instance of entity]) public        void Modify (Login.Model.UserInfo user)        {            //method body        
VB. NET method: The syntax format is

    ' Syntax: Access restriction function keyword function name (parameter [ByVal entity object instance]) as return value type public    Function Userlogon (ByVal User as entity.logonentity) as ENTITY.L Ogonentity        Dim user1 as New entity.logonentity              ' method body        Return user1    End Function

for the new knowledge, the new environment, the difficulties and hardships of all, all have feelings. To do such a simple summary, for the time a long, is sure to forget, now the difference between the syntax is condensed into small packets. When needed, open at any time, reduce the burden of memory.


Vb. NET vs C # syntax differences Show

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.