c# 命名空间命名规范
In C#.Net, "using" statement is used to import the namespace in our program
We can create a new namespace with the help of "using" statement
Correct answer: 1
In C#.Net, "using" statement is used to import the namespace in our program
In the given statement, 1st statement is correct.
正确答案:1
在C#.Net中,“ using”语句用于在我们的程序中导入名称空间
在给定的语句中,第一个语句是正确的。
Add reference of the library then use classes present in the namespace.
Include namespace in our project then use classes present in the namespace.
We need to install namespace into GAC and then we can use classes present in the namespace.
Correct answer: 2
Add reference of the library and include namespace into the project and then we can use classes present in the namespace.
In the given statement, the 2nd statement is correct.
正确答案:2
添加库的引用,并将命名空间包含到项目中,然后我们可以使用命名空间中存在的类。
在给定的语句中,第二条语句正确。
Correct answer: 1
Yes
Yes, we can use multiple using statements in a program.
using System;
namespace my_namespace
{
class sample
{
public static void sayHello()
{
Console.WriteLine("Hello");
}
}
class program
{
static void Main(string[] args)
{
sample.sayHello();
}
}
}
Correct answer: 2
Hello
The above code will print "Hello" on console screen.
Correct answer: 3
Any number of classes
We can create any number of classes in a namespace.
翻译自: https://www.includehelp.com/dot-net/csharp-namespace-aptitude-questions-and-answers-3.aspx
c# 命名空间命名规范