Can a Java class subclass both InputStream and OutputStream?
I would like to be able to extend both of these classes if it is possible.
Both InputStream and OutputStream are classes (not interfaces). Java doesn't support multiple inheritance, so it is not possible to subclass them directly.
However, by using composition you can have behaviours from these two classes in one class.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With