c#异常处理

1) There are the following statements that are given below, which is correct about an exception in C#.NET?

  1. The exception occurs at the time of compilation

  2. The exception occurs during program loading

  3. The exception occurs during JIT compilation

  4. The exception occurs during program execution

Answer & Explanation

Correct answer: 4
The exception occurs during program execution

In the above statements, the 4th statement is correct about exceptions.

1)下面给出了以下语句,关于C#.NET中的异常正确吗?

  1. 编译时发生异常

  2. 程序加载期间发生异常

  3. JIT编译期间发生异常

  4. 程序执行期间发生异常

答案与解释

正确答案:4
程序执行期间发生异常

在上面的语句中,第四条关于异常的说明是正确的。

2) In C#.NET, we write a program that generates a runtime error, and we did not write code to catch the exception, then which of the following will catch it?

  1. Common Language Runtime

  2. Operating System

  3. C# compiler

  4. Linker

Answer & Explanation

Correct answer: 1
Common Language Runtime

In the .NET framework, CLR is responsible for uncaught exceptions.

2)在C#.NET中,我们编写了一个生成运行时错误的程序,而我们没有编写代码来捕获该异常,那么下列哪个将捕获该异常?

  1. 通用语言运行时

  2. 操作系统

  3. C#编译器

  4. 连接器

答案与解释

正确答案:1
通用语言运行时

在.NET框架中,CLR负责未捕获的异常。

3) There are following options are given below, which is not useful to handle an exception in C#.Net?

  1. try

  2. catch

  3. errorcode

  4. finally

Answer & Explanation

Correct answer: 3
errorcode

In the .NET framework, "errorcode" is not useful to handle an exception.

3)下面给出了以下选项,这些选项对处理C#.Net中的异常没有用吗?

  1. 尝试

  2. 抓住

  3. 错误代码

  4. 最后

答案与解释

正确答案:3
错误代码

在.NET框架中,“错误代码”对于处理异常没有用。

4) There are following statements are given below, which is correct about try block in C#.NET?

  1. The try block is used to handle all types of exceptions and avoid program crashes

  2. We need to write code that can generate an exception inside the try block

  3. The try block executes completely whether an exception occurs or not

  4. The try block is used to catch exception generated at runtime

Answer & Explanation

Correct answer: 2
We need to write code that can generate an exception inside the try block

In the given statements, the 2nd statement is correct about the try block.

4)下面给出了以下语句,关于C#.NET中的try块是正确的吗?

  1. try块用于处理所有类型的异常并避免程序崩溃

  2. 我们需要编写可以在try块内生成异常的代码

  3. 无论是否发生异常,try块都会完全执行

  4. try块用于捕获运行时生成的异常

答案与解释

正确答案:2
我们需要编写可以在try块内生成异常的代码

在给定的语句中,第二条语句关于try块是正确的。

5) Can we use multiple catch blocks associated with try block in C#.NET?

  1. Yes

  2. No

Answer & Explanation

Correct answer: 1
Yes

Yes, we can use multiple catch blocks associated with the try block.

5)我们可以在C#.NET中使用与try块关联的多个catch块吗?

  1. 没有

答案与解释

正确答案:1

是的,我们可以使用与try块关联的多个catch块。

◀ C# Exception Handling Aptitude | Set 1 C# Exception Handling Aptitude | Set 3 ▶
#C#异常处理能力| 设置1 C#异常处理能力| 设置3▶

翻译自: https://www.includehelp.com/dot-net/csharp-exception-handling-aptitude-questions-and-answers-2.aspx

c#异常处理

c#异常处理_C#异常处理能力问题和解答 套装2相关推荐

  1. c#异常处理_C#异常处理能力问题和解答 套装4

    c#异常处理 1) Which is not a valid keyword used in the context of exception handling? try catch final fi ...

  2. 【嵌入式开发】ARM 异常向量表 ( 异常概念 | 异常处理流程 | 异常向量 | 汇编代码 )

    一. 异常向量表 1. 异常相关概念 (1) 异常 (2) 异常类型简介 2. 异常处理 (1) 异常处理 二. 异常向量表代码编写 1. 初始化异常向量表模块代码 2. 链接器脚本 3. Makef ...

  3. Java异常处理及异常机制介绍

    Java异常处理及异常机制介绍 当出现程序无法控制的外部环境问题(用户提供的文件不存在,文件内容损坏,网络不可用...)时,JAVA就会用异常对象来描述. JAVA中用2种方法处理异常: 1.在发生异 ...

  4. java 异常处理发生异常_处理Java中的异常

    java 异常处理发生异常 每个程序员都希望编写一个完美的程序. 也就是说,程序运行时没有任何障碍. 好吧,如果希望是马,乞g就会骑. 除了程序员的所有愿望之外,有时还会发生无法预料的情况. 在Jav ...

  5. 复习Java异常处理_异常分类_自定义异常_线程初步了解

    复习Java异常处理_异常分类_自定义异常_线程 主要内容 异常.线程 教学目标 第一章 异常 1.1 异常概念 异常,就是不正常的意思.在生活中:医生说,你的身体某个部位有异常,该部位和正常相比有点 ...

  6. 2异常处理_异常是什么?什么是常用类?

    第一节 异常 1. 异常的概念 ​ 异常(Exception) 即例外,程序没有按自己预想的结果运行出来,出现了非正常情况,即"程序得病了".怎么让我们写的程序做出合理的处理,不至 ...

  7. python的异常处理及异常类定义

    python的异常处理及异常类定义 参考文章: (1)python的异常处理及异常类定义 (2)https://www.cnblogs.com/summer-cool/p/3885581.html 备 ...

  8. java 异常处理发生异常_Java中的异常处理

    java 异常处理发生异常 Exception Handling in Java is a very interesting topic. Exception is an error event th ...

  9. 受检异常 非受检异常_C++异常实战之十一 使用scope_fail处理复杂场景(非fail-fast)下的异常...

    本章引入一个额外的机制scope_exit/scope_fail,以处理复杂场景下的cleanup与rollback,同时,对RAII语义进行一定语义上的修正,以提供一个更加友好的异常处理的心智模型. ...

最新文章

  1. 跳转到保护模式并显示一个LOGO
  2. android简单的计算器
  3. 一起学nRF51xx 21 -  蓝牙项目工程的初始化流程解读
  4. ToString()、Convert.ToString()、(string)、as string 的区别
  5. C++ Stacks(堆栈)
  6. Java通过Netty,实现Websocket消息推送简单几步搞定
  7. go zap去除程序名称_适用于Zip,Zap和Zoom游戏的Python程序
  8. VIM自动格式化C代码
  9. 如何快速下载CentOS7镜像
  10. Windows Server Version 1709 管理之入门篇 1
  11. linux安装phpunit,linux下安装phpunit
  12. 计算机丢失binkw32会怎么样,binkw32.dll 丢失 binkw32dll安装在哪
  13. bootstrap 模态窗口按钮位置_Bootstrap 模态框(Modal)插件的使用
  14. 三国将星录java阵容_三国将星录,通关攻略
  15. 目前M院M师的教学乱象
  16. 根据当前节点获取所有上层结构的组织(递归算法)
  17. Clover 驱动文件夹_通过AppleALC,轻松解决苹果声卡驱动的问题.
  18. Java架构师之路:从码农到年薪五十万的架构师
  19. 国内百家企业SRC一览表(安全应急响应中心)
  20. Android 截屏实现、屏幕截图、MediaProjection、ImageReader

热门文章

  1. matlab中 %s 是什么意思,ie在matlab中是什么意思
  2. DVWA upload
  3. 在linux关闭的命令,关于关闭Linux计算机的命令操作
  4. 华为python有必要学吗_【华为云技术分享】这个 Python 库有必要好好学学
  5. mac mysql密码错误_解决mac 下mysql安装后root用户登录密码错误问题
  6. java值栈_Struts2学习笔记-Value Stack(值栈)和OGNL表达式
  7. seata 如何开启tcc事物_微服务分布式事务4种解决方案实战
  8. oracle =1,oracle中的 where 1=1 和where 1 !=1
  9. 插件properties_Mybatis3系列 - 4. mybatis-config的properties属性详解
  10. 直面桌面云带来的现状优势