1

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?

1 Answer 1

4

Checked exceptions only have restrictions at compile time. At runtime, all types of exceptions behave the same way.

Sign up to request clarification or add additional context in comments.

5 Comments

Just waiting for other answers before flagging yours as the correct one.
What do you think of this :learnwithharsha.com/exceptions "The exceptions that are checked by the compiler for smooth execution of program are know as Checked Exception. We should handle checked exceptions in our program to compile."
@Jonas Do you mean in regards to smooth execution? I would assume they mean so that you don't get a surprise from an unchecked exception popping your entire stack.
I thought that checked exceptions where handled at compile time so that at runtime it would pop up faster to the catch block
@Jonas No, there is no difference at runtime.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.