All functions of callback must be declared inside the class.
• No source and header files
All functions of callback must be declared.
Int NotAllowed () // error, C # No global function
{
...
}
Sealed class Methods
{
Void Inline ()
{...
}
Void Error ()
{...
}; // Error. The function cannot end with a semicolon
Int AlsoError (); // error, implemented when the function must be declared
}
Like Java, C # does not allow global functions. All functions must be implemented in a class or structure. A function is a member of a class or structure. A function is also called a method.
C # Allow adding a semicolon to the class declaration, for example:
Sealed class Methods
{
...
}; // There can be a semicolon
However, C # does not allow adding a semicolon to the function declaration. For example:
Sealed class Methods
{Www.2cto.com
Void NotAllowed () {...}; // error. The function cannot end with a semicolon
}