I don;t quite understand where I can throw this exception.
For instance, I\'m implementing the Future
interface and don\'t want anyone calls t
When you want that the callers of your method to know that the operation is not supported you can throw the UnsupportedOperationException.
You can check here:
This exception extends the RuntimeException class and thus, belongs to those exceptions that can be thrown during the operation of the Java Virtual Machine (JVM). It is an unchecked exception and thus, it does not need to be declared in a method’s or a constructor’s throws clause. Moreover, the UnsupportedOperationException exists since the 1.2 version of Java.