2. Variable declaration:
VB. NET:VB.net: Dim variable name as type name [= initial value] [, variable name as type name [= initial value] [,…]
C #: type name variable name [= initial value] [, variable name [= initial value] [, variable name [= initial value] [,…];
Java: type name variable name [= initial value] [, variable name [= initial value] [, variable name [= initial value] [,…];
Example:
VB. NET: dim nvalue as integer
C #: int nvalue;
Java: int nvalue;
3. Constant declaration:
VB.net: constConstant name as type name = value [, constant name as type name = value [,…]
C #:ConstType name constant name = value [, constant name = value [, constant name = value [,…];
Java:FinalType name constant name = value [, constant name = value [, constant name = value [,…];
Example:
VB.net: Const PI as single = 3.1415926
C #: Const float Pi = 3.1415926;
Java:Final float Pi = 3.1415926;
4. object-oriented declaration:
Example:
VB. NET
Namespace evacn' domain
{Public class factory
Inherits building 'parent class
Implements iworker Interface
{
Public sub new () 'Constructor
'.....
End sub
Public sub finalize () 'destructor
'.....
End sub
Interface functions implemented by public overrides sub work implements iworker. Work
'.....
End sub
Public Function getname as string 'member function
Return ""
End Function
}
}
C #
Namespace evacn
{
Public class factory: Building, iworker
{
Public String getname ()
{
Return "heh ";
}
}
}
Java:
Package evacn;
Interface iworker {
Void work ();
}
Class factory extends building implements iwork {
Public Factory ()
}
Public finalize (){
'....
}
Public void work ()
{
'....
}
Public String getname ()
{
Return "heh ";
}