简体   繁体   English

性能:JAVA中已检查和未检查的异常

[英]Performance : Checked and unchecked exceptions in JAVA

I know the advantage of checked exceptions: Force developers to declare all exceptions thrown by their functions. 我知道检查异常的优点:强制开发人员声明其功能引发的所有异常。

But I was wondering: 但是我想知道:

-Do checked exceptions affect the performance positively? -检查异常是否会对性能产生积极影响?

-If so, Is a C# program slower than JAVA in case of exceptions? -如果是这样,在发生异常的情况下,C#程序是否比JAVA慢?

Checked exceptions only have restrictions at compile time. 受检查的异常仅在编译时有限制。 At runtime, all types of exceptions behave the same way. 在运行时,所有类型的异常的行为都相同。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM