Top "Checked-exceptions" questions

The exceptions that need to be declared in a method or constructor's `throws` clause if they can be thrown by the execution of the method or constructor and propagate outside the method or constructor boundary.

Understanding checked vs unchecked exceptions in Java

Joshua Bloch in "Effective Java" said that Use checked exceptions for recoverable conditions and runtime exceptions for programming errors (Item 58 …

java exception runtimeexception checked-exceptions unchecked-exception
Why is "throws Exception" necessary when calling a function?

class throwseg1 { void show() throws Exception { throw new Exception("my.own.Exception"); } void show2() throws Exception // Why throws is necessary …

java exception-handling unhandled-exception throws checked-exceptions
How do I fix a compilation error for unhandled exception on call to Thread.sleep()?

I am new to Java and kind of new to programming (I know diving straight into Java probably wasn't the …

java exception-handling checked-exceptions
How can I throw CHECKED exceptions from inside Java 8 streams?

How can I throw CHECKED exceptions from inside Java 8 streams/lambdas? In other words, I want to make code like …

java lambda java-8 java-stream checked-exceptions
The case against checked exceptions

For a number of years now I have been unable to get a decent answer to the following question: why …

java exception checked-exceptions
When to choose checked and unchecked exceptions

In Java (or any other language with checked exceptions), when creating your own exception class, how do you decide whether …

java exception checked-exceptions
Java 8: Mandatory checked exceptions handling in lambda expressions. Why mandatory, not optional?

I'm playing with the new lambda features in Java 8, and found that the practices offered by Java 8 are really useful. …

java lambda checked-exceptions java-8
Wrapping a checked exception into an unchecked exception in Java?

I have this factory method in java: public static Properties getConfigFactory() throws ClassNotFoundException, IOException { if (config == null) { InputStream in = Class.…

java exception checked-exceptions
writing a JUnit Test case for custom checked exception in Java?

I am writing a test case for my class that has methods which throw exceptions (both checked and runtime). I …

java exception try-catch junit4 checked-exceptions
Differences between Runtime/Checked/Unchecked/Error/Exception

What are the Runtime exceptions and what are Checked/Unchecked Exceptions and difference between Error/Exception.Why these many types? …

java exception exception-handling runtimeexception checked-exceptions