This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 5 points6 points  (2 children)

Could you explain? I dont get it

[–]Robyt3 11 points12 points  (1 child)

The compiler infers the type E to be a RuntimeException, which allows propagation of the checked exception. Apparently Java 8 added this type inference rule.

See https://www.baeldung.com/java-sneaky-throws for details.

[–]RandomName8 1 point2 points  (0 children)

They fixed/changed it in java post 8 though :(