博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
c# 命名空间命名规范_C#命名空间能力问题和解答 套装3
阅读量:2529 次
发布时间:2019-05-11

本文共 1861 字,大约阅读时间需要 6 分钟。

c# 命名空间命名规范

1) There are following namespaces are given below, which is correct about "using" statement in C#.NET?
Answer & Explanation

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”语句正确吗?
答案与解释

正确答案:1

在C#.Net中,“ using”语句用于在我们的程序中导入名称空间

在给定的语句中,第一个语句是正确的。

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?
Answer & Explanation

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)我们创建了一个库,其中一个包含类的名称空间,那么使用名称空间中存在的类的正确方法是什么?
答案与解释

正确答案:2

添加库的引用,并将命名空间包含到项目中,然后我们可以使用命名空间中存在的类。

在给定的语句中,第二条语句正确。

3) Is it possible that we can use multiple using statements in a program in C#.NET?
Answer & Explanation

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(); } }}
Answer & Explanation

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?
Answer & Explanation

Correct answer: 3

Any number of classes

We can create any number of classes in a namespace.

5)在一个命名空间中可以创建多少个类?
答案与解释

正确答案:3

任意数量的班级

我们可以在名称空间中创建任意数量的类。

翻译自:

c# 命名空间命名规范

转载地址:http://sdtzd.baihongyu.com/

你可能感兴趣的文章
mysql中间件研究(tddl atlas cobar sharding-jdbc)
查看>>
Cast-128 加密算法和 MyPassWord 的破解
查看>>
4.28下午 听力611
查看>>
ActiveMQ学习笔记(1)----初识ActiveMQ
查看>>
Java与算法之(2) - 快速排序
查看>>
Windows之IOCP
查看>>
机器学习降维之主成分分析
查看>>
CTP2交易所成交回报
查看>>
WebSocket & websockets
查看>>
《机器学习实战》学习笔记第二章 —— K-近邻算法
查看>>
uni-app 引入本地iconfont的正确姿势以及阿里图标引入
查看>>
DSB
查看>>
Java中的阻塞队列
查看>>
前端软件sublime的一些常用快捷键
查看>>
openssl 升级
查看>>
2017.10.30 天晴 昨天十公里没减肥
查看>>
Git 打标签(分布式版本控制系统)
查看>>
ASP.NET MVC:通过 FileResult 向 浏览器 发送文件
查看>>
CVE-2010-2883Adobe Reader和Acrobat CoolType.dll栈缓冲区溢出漏洞分析
查看>>
使用正确的姿势跨域
查看>>