RuntimeException or exception?

Possible duplicate:
In Java, when should I create a checked exception and when should it be a run-time exception?

I heard a lot of things about an exception from a RuntimeException, but no clear arguments have been given. I also see a lot of topics about stack overflow, but nobody seems to be directly asking this question (if so, thanks to closing it as a duplicate and show me the link!)

I would like to finally know when to use a RuntimeException and when to use a classic exception.

For business logic (for example, an exception may be a user error (bad data)), do you use an exception or runtime?

Do you have 2 or 3 tips that you submit to choose either an exception or a runtime exception when creating your own exception (in business logic)?

+6
source share

Source: https://habr.com/ru/post/905315/


All Articles