0

I am aware of the Checked and Unchecked Exception in Java.

In a multi-tiered environment, does unchecked Exception has a better performance over checked Exception?

4
  • 2
    Absolutely zero performance difference. They're both just Exceptions. Checked/unchecked is purely a compile-time concept. Commented Nov 15, 2015 at 5:06
  • Gentleman, down vote comments please. Commented Nov 27, 2015 at 15:56
  • Don't look at me, I didn't DV. And I'm probably the only person who would be notified or notice on a comment on a 2-week-old question. Commented Nov 27, 2015 at 15:59
  • 1
    Good, because I have no particular incentive to lie; I could just stay quiet... Now, what is wrong with my answer? :) Commented Nov 27, 2015 at 16:02

1 Answer 1

2

There is absolutely zero performance difference. They're both just Exceptions.

Checked-/unchecked-ness is purely a compile-time concept.

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

4 Comments

is unchecked exception " compile-time concept" ??
As far as I can see, 11.3. Run-Time Handling of an Exception draws no distinction between unchecked and checked exceptions - it doesn't even mention the terms.
@Rehman A checked exception is verified by the compiler to be either caught (try-catch) or listed in the throws clause of the method. There is no run-time check for that. See "Compile-Time Checking of Exceptions" and "Run-Time Handling of an Exception" in the JLS. Therefore, the difference between checked and unchecked is a compile-time concept.
Thanks all for the answer. :-)

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.