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 
- We cannot use "using" statement in C#.NET 
- We can use "using" statement in VB.NET only 
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.
- 在C#.Net中,“ using”语句用于在我们的程序中导入名称空间 
- 我们可以在“ using”语句的帮助下创建一个新的命名空间 
- 我们不能在C#.NET中使用“使用”语句 
- 我们只能在VB.NET中使用“使用”语句 
 正确答案:1 
 在C#.Net中,“ using”语句用于在我们的程序中导入名称空间 
在给定的语句中,第一个语句是正确的。
- Add reference of the library then use classes present in the namespace. 
- Add reference of the library and include namespace into the project and then we can 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.
- 添加对库的引用,然后使用名称空间中存在的类。 
- 添加库的引用,并将命名空间包含到项目中,然后我们可以使用命名空间中存在的类。 
- 在我们的项目中包含名称空间,然后使用名称空间中存在的类。 
- 我们需要将名称空间安装到GAC中,然后才能使用名称空间中存在的类。 
 正确答案:2 
 添加库的引用,并将命名空间包含到项目中,然后我们可以使用命名空间中存在的类。 
在给定的语句中,第二条语句正确。
- Yes 
- No 
Correct answer: 1
Yes
Yes, we can use multiple using statements in a program.
- 是 
- 没有 
 正确答案:1 
 是 
是的,我们可以在一个程序中使用多个using语句。
using System;
namespace my_namespace
{
class sample
{ 
public static void sayHello()
{
Console.WriteLine("Hello");
}
}
class program
{
static void Main(string[] args)
{
sample.sayHello();
}
}
}
- Syntax error 
- Hello 
- Linker error 
- Runtime exception 
Correct answer: 2
Hello
The above code will print "Hello" on console screen.
- 语法错误 
- 你好 
- 链接器错误 
- 运行时异常 
 正确答案:2 
 你好 
上面的代码将在控制台屏幕上打印“ Hello” 。
- 2 
- 1 
- Any number of classes 
- 5 
Correct answer: 3
Any number of classes
We can create any number of classes in a namespace.
- 2 
- 1个 
- 任意数量的班级 
- 5 
 正确答案:3 
 任意数量的班级 
我们可以在名称空间中创建任意数量的类。
翻译自: https://www.includehelp.com/dot-net/csharp-namespace-aptitude-questions-and-answers-3.aspx
c# 命名空间命名规范