c# 命名空间命名规范_C#命名空间能力问题和解答 套装3
c# 命名空間命名規(guī)范
1) There are following namespaces are given below, which is correct about "using" statement in C#.NET?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.
1)下面給出了以下名稱空間,這與C#.NET中的“ using”語句正確嗎?在C#.Net中,“ using”語句用于在我們的程序中導(dǎo)入名稱空間
我們可以在“ using”語句的幫助下創(chuàng)建一個新的命名空間
我們不能在C#.NET中使用“使用”語句
我們只能在VB.NET中使用“使用”語句
正確答案:1
在C#.Net中,“ using”語句用于在我們的程序中導(dǎo)入名稱空間
在給定的語句中,第一個語句是正確的。
2) We created a library, in which a namespace that contains classes, then what is the correct way to use classes present in a namespace?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.
2)我們創(chuàng)建了一個庫,其中一個包含類的名稱空間,那么使用名稱空間中存在的類的正確方法是什么?添加對庫的引用,然后使用名稱空間中存在的類。
添加庫的引用,并將命名空間包含到項目中,然后我們可以使用命名空間中存在的類。
在我們的項目中包含名稱空間,然后使用名稱空間中存在的類。
我們需要將名稱空間安裝到GAC中,然后才能使用名稱空間中存在的類。
正確答案:2
添加庫的引用,并將命名空間包含到項目中,然后我們可以使用命名空間中存在的類。
在給定的語句中,第二條語句正確。
3) Is it possible that we can use multiple using statements in a program in C#.NET?Yes
No
Correct answer: 1
Yes
Yes, we can use multiple using statements in a program.
3)是否可以在C#.NET的程序中使用多個using語句?是
沒有
正確答案:1
是
是的,我們可以在一個程序中使用多個using語句。
4) What is the correct output of the given code snippet? 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.
4)給定代碼段的正確輸出是什么?語法錯誤
你好
鏈接器錯誤
運行時異常
正確答案:2
你好
上面的代碼將在控制臺屏幕上打印“ Hello” 。
5) How many classes can be created in a namespace?2
1
Any number of classes
5
Correct answer: 3
Any number of classes
We can create any number of classes in a namespace.
5)在一個命名空間中可以創(chuàng)建多少個類?2
1個
任意數(shù)量的班級
5
正確答案:3
任意數(shù)量的班級
我們可以在名稱空間中創(chuàng)建任意數(shù)量的類。
? C# Namespace Aptitude | Set 2 C# Namespace Aptitude | Set 4 ? #C#命名空間能力| 設(shè)置2 C#命名空間能力| 設(shè)置4?翻譯自: https://www.includehelp.com/dot-net/csharp-namespace-aptitude-questions-and-answers-3.aspx
c# 命名空間命名規(guī)范
總結(jié)
以上是生活随笔為你收集整理的c# 命名空间命名规范_C#命名空间能力问题和解答 套装3的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Java ObjectOutputStr
- 下一篇: css禁用选中文本_使用CSS禁用文本选