What’s a good example for class inheritance? [closed]

I like the Stream hierarchy. The idea is that anything can use a stream without usually caring what kind of stream it is, and individual subclasses handle the storage differently (e.g. NetworkStream, MemoryStream and FileStream in .NET).

If you’re interested in interfaces, then IEnumerable<T> in .NET is a great one – you can iterate over any collection without caring what the underlying data structure is.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)