As far as we can see, FilterInputStream class extends InputStream class. It's simple because FilterInputStream instance "is-a" InputStream instance. But also there is a field which type is InputStream in FilterInputStream class, it means that InputStream is a "part-of" FilterInputStream. They used composition and inheritance both. What kind of problems does this decision solve? What for? Is it just well-known pattern?
Asked
Active
Viewed 202 times
0
igor.tsutsurupa
- 189
- 1
- 6
-
4Look up the Decorator pattern – anthonyvd Jul 03 '13 at 18:28
-
Just look at http://stackoverflow.com/questions/3068912/what-is-the-most-used-pattern-in-java-io – Dmitry Zagorulkin Jul 03 '13 at 18:51