Why Class CloneNotSupportedException is a checked Exception and does not extend RuntimeException instead?

java

Solution

Why is it a checked Exception?

I suspect the answer is really: "because when Java first came out, there was very little experience of when it would make sense for an exception to be checked." Back then, they didn't have Effective Java :)

There are various things like this - exceptions which are checked but probably shouldn't be, and occasions where the exception is unchecked but should be checked... `Integer.parseInt` throwing `NumberFormatException` probably being the clearest example.

Problem

How can the caller of `clone()` possibly recover if they encounter a CloneNotSupportedException ? Why is it a checked Exception ?

Original source