Task1813 and task1814 were beyond my capabilities at the moment and I downloaded the correct solutions. Now I am learning from the ready solutions.:) task1813 : it creates a custom OutputStream class by wrapping the FileOutputStream. All the methods had to be overwritten, the calls are forwarded to the original=wrapped object. Result: the custom stream works the same as a regular FileOutputStream, only with extra functionality added. task1814: it ceates a custom InputStream class by NOT wrapping the FileInputStream. It is solved by plain inheritance. Adds extra functionality in its constructor. No method needed to be overwritten! Result: works the same as a regular FileInputStream, only extra functionality is added. The two tasks are solved differently, one uses wrapper technique, the other does not. But the result seems to be the same: our own stream class works the same as the original Java one, with a little extra functionality. My question: Is one solution better than the other? Is there any benefit to one, disadvantage to the other? Is there any significant difference - that I don't notice?
What is the difference between wrapper and inheritance?