我有抛出异常后,打破?我有、抛出、异常

2023-09-04 00:52:09 作者:半透明 no color

我写在C#中的自定义类,我抛出了几个例外,如果人们给了错误的输入中的一些方法。如果抛出异常,将所有的code的方法后抛出仍执行?我必须把断线抛出之后,还是一抛永远退出方式?

I'm writing a custom class in C# and I'm throwing a couple exceptions if people give the wrong inputs in some of the methods. If the exception is thrown, will any of the code in the method after the throw still be executed? Do I have to put a break after the throw, or does a throw always quit the method?

推荐答案

在您的抛出异常,要得到执行下一个code是覆盖的方法内抛出任何catch块(如果有的话),那么,在的