C# | VB.Net | |
Case sensitive | Yes | No |
Self reference to current object | this | me |
No explicit instance of object needed | static | Shared |
Refer to base class | base | MyBase |
Declare class that can't be inherited | sealed | NotInheritable |
Declare method that can't be overridden | sealed | NotOverridable |
Declare method that can be override in derived class | virtual | Overridable |
Declare method that must be override in derived class | abstract | MustOverride |
Declare a class must be inherited. An instance of the class cannot be created | abstract | MustInherit |
Comments | /* comment */ | 'comment |
Empty object | null | Nothing |
Method that does not return value | void | Sub |
Declare a variable | int a = 0; | Dim a as Integer = 0 |
Declare an array | int[] a =new int[3]; | Dim a() As Integer |
Declare an enumeration | enum | Enum |
Iteration loop structure | for | For ... Next |
Conditional loop structure | while | While ... End While |
Conditional statement | if ... else ... | If...Else...End If |
Operator and data types
C# | VB.Net | |
Equal | == | = |
Not equal | != | <> |
Division | / | \ |
Modulus | % | Mod |
Logical AND | && | And |
Logical OR | || | Or |
Logical NOT | ! | Not |
Integer datatype | int | Integer |
String datatype | string | String |
Boolean datatype | bool | boolean |
Byte datatype | byte | Byte |
Decimal datatype | decimal | Decimal |
Float datatype | float | Single |
Double datatype | double | Double |
Date datatype | DateTime | Date |