Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
VB.NET C# Comments
Specifies that a
NotOverridable sealed method cannot be
overriden.
Specified that a
MustOverride abstract method must be
implemented in a
derived class.
Specifies that a
Overridable virtual member can be
overriden.
Specifies that a
member is shared by
all instances of a
Shared static class. An instance of
the class is not
required to call the
member.
Class/member is
Public public visible outside of
project or assembly.
Class/member is
Friend internal invisible outside of
the assembly.
Class/member is
Private private visible only within
the project.
Specifies that a
Overloads not required member is
overloading another
member.
Specifies that a
Overrides override member is overriding
another member.
Shadows new
Method called by
system just before
Finalize ~C1 (destructor) garbage collection
reclaims object. C1 is
classname.
Constructor method,
New C1 called when object is
created. C1 is
classname.
Declares variable x
Dim x as Int32 Int32 x as type
System.Int32.
Dim t1 As New
SomeType()
Try
t1.SomeMethod()
Finally
using(SomeType t1 = new
If (t1 Is Nothing)
SomeType())
Then
{
If TypeOf t1 Is
t1.SomeMethod;
IDisposable Then
}
CType(t1,
IDisposable).Dispose()
End If
End If
End Try
Allows methods to be
Imports using called without fully
qualifying with
Namespace name.
<> [] Specifies
parameters.
Function x as Int32 Int32 x Specifies return
values (Int32 and
Sub y void y none).
Line continuation
_ ; character in VB, end
of line character in
C#.
AndAlso &&
Short circuit versions
of And and Or.
OrElse ||
X+=1 (x=x+1)
x++
Short cut
X-=1 (x=x-1)
incrementers.
x--
also *=, /=, ^= etc..
Redimensions an
ReDim Preserve no equivalent
array.
Specifies and
Optional need to overload sub instead
optional parameter.
switch(I)
Select Case x
{
Case True
case 1:break;
Case Else
default:break;
End Select
};
Make a non-virtual
call to a virtual
MyClass no eqivalent
method of the
current object.
Declare that an
no equivalent volatile object can be
modifed
asynchronously.
Specify default
Default must use indexer
method of a class.
Declare a variable
WithEvents no equivalent whose events you
wish to handle.
Try
try{}
Catch
catch{} Structured exception
Finally
finally{} handling
End Try
REM /* ... */
Comment lines
' //
Dim x As String =
string x = "hello";
"Hello"
char y; Retrieve a character
Dim y As Char = from a String.
y = x[1];
GetChar(x, 1)
Evaluate an object
With ... End With no equivalent one and use many
times.
Event
event Declare and raise an
event.
RaiseEvent
- Variable in Structure
Defaults to Public Scope
- Structure
- Class
- Method in Class - struct
- Method in Structure - class