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
Yes, you are right.
The author of UnsupportedException is Joshua Bloch and as per his book and also from Collections design FAQ, if the object does not support an operation, the method can throw UnsupportedException.
Caution should be taken before throwing this exception in your method because, it is of type RuntimeException/unchecked exception.
Link to the book
Author of the book and UnsupportedException class : Joshua Bloch
/**
* Thrown to indicate that the requested operation is not supported.
*
* This class is a member of the
*
* Java Collections Framework.
*
* @author Josh Bloch
* @version %I%, %G%
* @since 1.2
*/
public class UnsupportedOperationException extends RuntimeException {
...
}