Questions tagged [unchecked-exception]

In Java programming, an exception that does not need to be declared in a method's throws clause, and is not required to be caught.

RuntimeException is the superclass of those exceptions that can be thrown during the normal operation of the Java Virtual Machine.

RuntimeException and its subclasses are unchecked exceptions. Unchecked exceptions do not 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.

Details: http://docs.oracle.com/javase/7/docs/api/java/lang/RuntimeException.html

63 questions
-2
votes
1 answer

Is Exception checked or not in JAVA?

Consider the following code public void myMethod1() { try { this.getClass().getMethod("myMethod").invoke(this); } catch (Exception e) { throw e; } } public void myMethod1_fixed() throws Exception { try { …
user1589188
  • 5,316
  • 17
  • 67
  • 130
-3
votes
1 answer

Reference of all checked / unchecked exceptions in the standard API

I'm trying to learn about exceptions in Java and, for educational purposes, it would be nice if I could get hold of a reference of all checked exceptions and all unchecked exceptions in the standard API. Related question but not quite what I'm…
Sizons
  • 640
  • 2
  • 8
  • 24
-4
votes
1 answer

Why can't Java Lambda throw an checked exception

I'm learning Java and am a bit confused, why Lambda Expressions can't throw checked exceptions. Anyone has an understandable explanation for this? I read through this post: Java 8 Lambda function that throws exception? and this one: java throwing…
1 2 3 4
5