1. Interface interface
Classes in C # cannot inherit more, meaning that a class cannot inherit from more than one base class at a time. But a class can inherit multiple interfaces, which is a constraint that specifies the functions that the class that inherits from it should implement.
An interface uses the interface keyword declaration, which is similar to a class declaration. The interface declaration is public by default.
An interface can inherit from another interface, at which point the interface has the methods of the interface it inherits from, and if a class inherits from that interface, then that class needs to implement all the methods.
2. Namespaces
Namespaces are designed to provide a way to separate a set of names from other names. The name of a class declared in one namespace does not conflict with the name of the same class declared in another namespace.
The definition of a namespace begins with the keyword namespace , followed by the name of the namespace, as follows:
namespace namespace_name{ //code declaration}
in order to invoke a function or variable that supports the namespace version, the name of the namespace is placed in front, as follows:
Namespace_name.item_name;
Namespaces support nesting, you can declare another namespace within one namespace:
namespace Namespace_name1 { //Code declaration namespace Namespace_name2 { //code declaration }}
3. Pre-processing instructions
Create symbolic constants #define preprocessor directives.
#define allows you to define a symbol so that the expression returns true by using the symbol as the expression passed to the #if instruction. It has the following syntax: #define Symbol
#define PI using System;namespace preprocessordappl{ class program { static void Main (string[] args) { #if (PI) Console.WriteLine ("PI is defined"); #else Console.WriteLine ("PI is not defined"); #endif Console.readkey ();}}}
C # drip (ii)