3 ms·
The language doesn't force them to do that--they could override the interface and not declare the Exception. Then if you were working with an object declared to
by hyperpape 6y ago
The language doesn't force them to do that--they could override the interface and not declare the Exception. Then if you were working with an object declared to be ByteArrayOutputStream, you wouldn't need to handle the Exception. If working with the interface, you would, because that's the point of an interface.
- twic 6y agoYes, this is a poor example. The declaration of that exception is either a mistake, or a way of reserving some wiggle room for future changes.