Import C # class
1 answer
Importing namespaces is done in C # with the directive using
:
using com.test;
However, there is currently no way to import the class. However, importing classes is a new feature introduced in C # 6 (which will ship with Visual Studio 2015).
In C #, namespaces are semi-equivalent Java packages. To declare a namespace, you just need to do something like this:
namespace com.test
{
class Test {}
}
If the class is declared in a separate assembly (for example, in a class library), simply adding a directive is using
not enough. You must also add a reference to another assembly.
+7
source to share